OSDN Git Service

348e2d0382cf5ca14a6a030edf373f0d3060b17a
[bacon/BaCon-Japanese.git] / 関数・命令 / GLOBAL.txt
1   GLOBAL
2
3   【1.0 build 10 追加】
4    GLOBAL <var>[,<var2>,<var3>,...] [TYPE]|ASSOC <c-type> | [ARRAY <size>]
5
6    Type: statement
7
8    Explicitly declares a variable to a C-type. The ASSOC keyword is used to
9    declare associative arrays. This is always a global declaration, meaning
10    that variables declared with the GLOBAL keyword are visible in each part
11    of the program. Use LOCAL for local declarations.
12
13    The ARRAY keyword is used to define a dynamic array, which can be
14    resized with REDIM at a later stage in the program.
15
16    Optionally, within a SUB or FUNCTION it is possible to use GLOBAL in
17    combination with RECORD to define a record variable which is visible
18    globally.
19
20    GLOBAL x TYPE float
21    GLOBAL q$
22    GLOBAL new_array TYPE float ARRAY 100
23    GLOBAL name$ ARRAY 25
24
25    Multiple variables of the same type can be declared at once, using a
26    comma separated list. In case of pointer variables the asterisk should
27    be attached to the variable name:
28
29    GLOBAL x, y, z TYPE int
30    GLOBAL *s, *t TYPE long
31