Let
Syntax
Let.<type> [<variable> [= <expression>], <variable> [= <expression>], ...]
Description
If no <variables> are specified, Let is used to change the default type for future untyped variables (including procedure parameters and interface method parameters). The initial default type is long (.l). Each variable can have a default value directly assigned to it.
Example:
d = e + f
Let.w
a = b + c
d, e and f will be created as long type variables, since there was no type specified. a, b and c will be signed word typed (.w) as no type is specified and the default type had been changed to the word type.
If variables are specified, Let only declares these variables as "defined type" and will not change the default type.
Example:
Let.b a, b = 10, c = b*2, d ; these 4 variables will be byte typed (.b)
Syntax
Let <variable>.<type> [= <expression>] [, <variable>.<type> [= <expression>], ...]
Description
Alternative possibility for the variable declaration using Let.
Example:
Let MyChar.c
Let MyLong.l
Let MyWord.w
Debug SizeOf(MyChar) ; will give 1 byte
Debug SizeOf(MyLong) ; will give 4 bytes
Debug SizeOf(MyWord) ; will give 2 bytes
Change Define word to Let word
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Change Define word to Let word
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
IIRC, the LET keyword was redundant and meant to be used with equals in older basics. Eg:
So I don't think it does the same thing as Define, which, well, defines a variable and IMO is superior to Dimming a scalar or LETting a variable.
So (sorry Pyschophanta) my vote is against LET. But then again, IIRC, "this is not a democracy."
Code: Select all
DIM A%
LET A% = 1So (sorry Pyschophanta) my vote is against LET. But then again, IIRC, "this is not a democracy."
Dare2 cut down to size
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
- Psychophanta
- Always Here

- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Franky wrote:Feature AddedCode: Select all
Macro LET Define EndMacro[/code]
Code: Select all
Macro LET
Define
EndMacro
Define.s="hi"
Um, you typed too fast, Pyscho!
. You can't assign a value to define, with or without a macro.
Some definitions of Let: "to allow", "to assign", "to permit", "to lease", "to cause or make".
Code: Select all
Macro LET
Define
EndMacro
;Define.s = "hi" <- invalid, same as Global.s="Hello" is invalid.
Define myString.s = "hi"
LET myStr.s = "There"Dare2 cut down to size


