< Futurebasic < Language < Reference 
      LET
Syntax
1.[LET] var = expr2.
[LET] var;length = address&
Description
The LET statement assigns a value to the variable var, replacing whatever value var had before. Note that the LET keyword is optional.
- If you use Syntax 1, the value of expris assigned tovar:
- If varis a numeric variable, thenexprcan be any numeric expression; ifexpris outside the range or precision that can be stored invar, then the expression will be appropriately converted.
- If varis a POINTER variable, thenexprcan be _nil (zero), or another POINTER variable of the same type, or any valid address expression.
- If varis a HANDLE variable, thenexprcan be _nil (zero), or another HANDLE variable of the same type, or any valid address expression whose value is a handle.
- If varis a string variable, thenexprcan be any string expression. You should make sure that the length ofexprdoes not exceed the maximum string size that will fit intovar.
- If varis a "pseudo" record (declared usingDIM var.constant), thenexprmust be a record variable declared with the same length asvar.
- If varis a "true" record (declared usingDIM var AS recordType), thenexprmust be a record variable of the same type asvar.
If you use Syntax 2, then length bytes are copied into var, from the memory location starting at address&. The length parameter must be a static integer expression (i.e., it cannot contain any variables). Note that FB does not check whether length actually equals the size of var. If length is too small, an incomplete value will be copied into var; if length is too big, data will be copied into addresses beyond var's location in memory (this can be dangerous).
See Also
DIM; DIM RECORD; BEGIN RECORD; BLOCKMOVE; DEF BLOCKFILL; Constant declaration statement
    This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.