[Next] [Up] [Previous]

The COPY Statement

The COPY statement has the same syntax as the LET statement, but does not perform any implicit type conversion upon assignment; instead, the variable on the right-hand side of the equals sign has the contents, in memory, of the internal representation of the value of the expression on the right-hand side copied into its own memory space.

COPY to a MUTABLE variable has the same result as LET unless the MUTABLE variable has been subjected to a FREEZE statement.

COPY, like A format input/output, respects the distinction between the data part of a variable, and any descriptor parts (the length of a STRING, the type and structure of a MUTABLE variable), and does not cause transfer between data and descriptor parts of variables. Thus, COPY from a CHARACTER variable to a STRING variable copies from the static part of the CHARACTER variable into the dynamic part of the STRING variable; the character data is not copied into the STRING variable's descriptor part. This is not true of EQUIVALENCE, which only operates on the static parts of variables (whether they are STATIC or AUTO or of another storage class).


[Next] [Up] [Previous]