REWRITE Collection Statement

Overwrites an element in the list or dictionary.

rewrite-collection-statement

Where: identifier is the name of the list or dictionary collection type.

Note: Other formats of this statement are available. See Statements in the COBOL Language Reference.

Example

The following overwrites the first element in the list stringList.

       rewrite stringList from "ITEM REWRITE" key 0
       display "The contents of the list after rewrite element 0 : "           
       invoke displayListContents(stringList)

See also the Collections sample, which is available from Start > All Programs > Micro Focus Enterprise Developer > Samples > Visual COBOL Samples, under COBOL for .NET.