![]() |
Where: identifier is the name of the list or dictionary collection type.
次の例では、リスト集合から要素を読み取ります。
declare val as string
read stringList into val key 0
次の例に、辞書集合の無効なキーを読み取るときの例外処理と例外捕捉を示します。
display "reading an invalid key message : "
read stringDictionary into val key "RUBBISH"
invalid key
display "Caught invalid key"
not invalid key
display "Shouldn't see this"
end-read
集合のサンプルも参照してください。このサンプルは、 Start > All Programs > Micro Focus Visual COBOL > Samples , under COBOL for JVM (Windows) or $COBDIR/demo (UNIX). に用意されています。