PERFORM..USING 指定の type-specifier セクションでは、System.IDisposable インターフェイスを実装する型を指定する必要があり、= expression 構文を使用して初期値を指定する必要があります。
変数は反復子の使用地点で宣言でき、その範囲は perform ブロックの最後までになります。
*> In this case, the scope of i is until the end of the perform block. perform varying i as binary-long from 1 by 1 until i > 10 display i end-perform *> So the i in the following perform block is a new instance of i, *> independent of the i in the preceding perform block. perform varying i as binary-short from 0 by 1 until i > 10 display i end-perform
次に、k をインラインで宣言して、辞書を反復します。繰り返しになりますが、範囲は、対応する end-perform までになります。
01 dict1 dictionary[string string]. create dict1 write dict1 from "Anthony" key "A" write dict1 from "Brian" key "B" write dict1 from "Charles" key "C" perform varying key k as string value val as string through dict1 display k ":" val end-perform perform varying value val as string through dict1 display val end-perform perform varying key k as string through dict1 display k end-perform
ローカル変数サンプルも参照してください。このサンプルは、Samples Browserに用意されています。手順については、「サンプル ブラウザーを起動するには」を参照してください。