OSDN Git Service

41fc14eed863bcef40bb12da3d4cb8b04d6a7acb
[bacon/BaCon-Japanese.git] / 関数・命令 / LOOKUP.txt
1   LOOKUP
2
3   【1.0 build 15 追加】
4    LOOKUP <assoc> TO <array> SIZE <variable>
5
6    Type: statement
7
8    Retrieves all indexnames created in an associative array. The results
9    are stored in <array>. As it sometimes is unknown how many elements this
10    resulting array will contain, the array should not be declared
11    explicitly. Instead, LOOKUP will declare the result array dynamically.
12
13    If LOOKUP is being used in a function or sub, then <array> will have a
14    local scope. Else <array> will be visible globally, and can be accessed
15    within all functions and subs.
16
17    The total amount of elements created in this array is stored in
18    <variable>. This variable can be declared explicitly using LOCAL or
19    GLOBAL. Example:
20
21    LOOKUP mortal TO men$ SIZE amount
22    FOR x = 0 TO amount - 1
23        PRINT men$[x]
24    NEXT
25