WRITE コレクション文

リストまたは辞書に要素を書き込みます。

Context:

    手続き部
        

write-collection-statement

注: Other formats of this statement are available. See in the COBOL 言語リファレンス.

次の例では、リストの集合を宣言して作成してから、リストに要素を書き込みます。

       declare stringList as list[string]
       create stringList
       write stringList from "item 0"

次の例では、perform ループを使用してさらに 5 つの要素をリストに書き込みます。

       perform varying i as binary-long from 1 by 1 until i > 5
           write stringList from "item " & i
       end-perform

       display "The contents of the list : "           
       invoke displayListContents(stringList)

集合のサンプルも参照してください。このサンプルは、 Start > All Programs > Micro Focus Enterprise Developer > Samples > Visual COBOL Samples, under COBOL for .NET. に用意されています。