DECLARE 文 (JVM COBOL)

手続き部本文内でローカル変数を 1 つ以上宣言する。インライン ローカル変数の範囲は、宣言のポイントから最奥の包含ブロックの最後までである。段落、節、メソッド全体は、ブロックと見なされる。

コンテキスト:

手続き部 

declare-statement

AS 型指定子を使用した DECLARE 文の構文
DECLARE 文の一般的な構文

       declare i1 as binary-long
       display i1 
         
       *>   Optionally, the variables can be initialised inline 
        declare c2 as condition-value = true
        display c2

        declare string-list2 as string occurs 3 = table of string("Bill", "Ben", "LittleWeed")

ローカル変数のサンプルも参照してください。このサンプルは、[スタート > すべてのプログラム > Micro Focus Enterprise Developer > Samples > Visual COBOL Samples]、 の場合JVM COBOL 言語リファレンスの場合 に用意されています。

その他の情報

変数に対して明示的な型が宣言されていない場合、値が整数以外の数値であれば (declare var1 = 1.23 など)、値は float-long 型であると見なされる。