Define


Syntax
Define.<type> [<variable> [= <expression>], <variable> [= <expression>], ...]
Description
If no <variables> are specified, Define is used to change the default type for future untyped variables (including procedure parameters, interface method parameters and data to read with the Read keyword). The initial default type is integer (.i). Each variable can have a default value directly assigned to it.

Example:

  d = e + f
  Define.w
  a = b + c 
d, e and f will be created as integer 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, Define only declares these variables as "defined type" and will not change the default type. If you don't assign a value to the variables at this time, the value will be 0.

Example:

  Define.b a, b = 10, c = b*2, d ; these 4 variables will be byte typed (.b)

Syntax
Define <variable>.<type> [= <expression>] [, <variable>.<type> [= <expression>], ...] 
Description
Alternative possibility for the variable declaration using Define.

Example:

  Define MyChar.c 
  Define MyLong.l 
  Define MyWord.w 
  
  Debug SizeOf(MyChar)   ; will give 1 byte
  Debug SizeOf(MyLong)   ; will give 4 bytes
  Debug SizeOf(MyWord)   ; will give 2 bytes