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.

Define may also be used with arrays, lists and maps.

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 print 1 in ASCII mode, and 2 in unicode mode
  Debug SizeOf(MyLong)   ; will print 4
  Debug SizeOf(MyWord)   ; will print 2