PLIMOVE Subroutine

Purpose

Fills n bytes from one address to another.

Syntax

CALL PLIMOVE(x, y, z);

Parameters

x and y are expressions declared POINTER or OFFSET. If OFFSET, x or y must be declared with the AREA attribute.

z is an expression that is converted to FIXED BINARY(31,0).

Description

The PLIMOVE built-in subroutine moves z storage units (bytes) from location y to location x, without any conversions, padding, or truncation. Unlike the PLIOVER built-in, subroutine, storage at locations x and y are assumed to be unique.

The PLIFILL, PLIMOVE and PLIOVER built-in subroutines are also useful in managing buffers.

Examples

foo: proc() options(main);

DCL PLIMOVE builtin;

DCL mystring char(10) init('AAAAAAAAAA');
DCL mystring2 char(10) init('BBBBBBBBBB');

CALL PLIMOVE(addr(mystring), addr(mystring2), length(mystring2));
    
PUT DATA(mystring);

end;

Restrictions

If storage overlaps, unpredictable results can occur.