OSDN Git Service

SourceForge.JP で Mac 旧来の改行コード( CR のみ)の場合に正常に処理されないので、改行コードを変更。
[bacon/BaCon-Japanese.git] / 関数・命令 / VAR.txt
1   VAR
2
3    VAR <array$> SIZE <x>
4
5    Type: statement
6
7    Declares a variable argument list in a FUNCTION or SUB. There may not be
8    other variable declarations in the function header. The arguments to the
9    function are put into an array of strings, and the resulting amount of
10    elements is stored in <x>. Example:
11
12    OPTION BASE 1
13    SUB demo (VAR arg$ SIZE amount)
14        LOCAL x
15        PRINT "Amount of incoming arguments: ", amount
16        FOR x = 1 TO amount
17            PRINT arg$[x]
18        NEXT
19    END SUB
20
21    ' No argument
22    demo(0)
23    ' One argument
24    demo("abc")
25    ' Three arguments
26    demo("123", "456", "789")
27