REWRITE Collection Statement

Overwrites an element in the list or dictionary.

rewrite-collection-statement

GUID-7FC564F6-DD7E-4D36-9A3C-B6E0174BE469-low.png

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 Visual COBOL > Samples, under COBOL for .NET .