OSDN Git Service

ccd5cda6541b26130af920970f5e3bec846996a9
[bacon/BaCon-Japanese.git] / 関数・命令 / LOCAL.txt
1   LOCAL
2
3    LOCAL <var>[,<var2>][,<var3>][,...] [TYPE <c-type>] [ARRAY <size>]
4
5    Type: statement
6
7    This statement only has sense within functions, subroutines or records.
8    It defines a local variable <var> with C type <type> which will not be
9    visible for other functions, subroutines or records, nor for the main
10    program.
11
12    If the TYPE keyword is omitted then variables are assumed to be of
13    'long' type. If TYPE is omitted and the variablename ends with a '$'
14    then the variable will be a string.
15
16    The ARRAY keyword is used to define a dynamic array, which can be
17    resized with REDIM at a later stage in the program.
18
19    Example:
20
21    LOCAL tt TYPE int
22    LOCAL q$
23    LOCAL new_array TYPE float ARRAY 100
24    LOCAL name$ ARRAY 25
25
26    Multiple variables of the same type can be declared at once, using a
27    comma separated list. In case of pointer variables the asterisk should
28    be attached to the variable name:
29
30    LOCAL x, y, z TYPE int
31    LOCAL *s, *t TYPE long
32