CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-38
Memory_Repeat
Memory_Repeat
The Memory_Repeat procedures fill a block of memory with a block of values a
specified number of times. These functions are not available in the native CRE library.
dest
is a pointer to the block of memory to fill.
values
is a pointer to the block of values to replicate into dest.
values_len
specifies the size of values in bytes.
num_rep
specifies the number of times to replicate values into dest.
Considerations
The Memory_Repeat procedures are declared as procedures, not as functions. They
do not return a value. They also ensure that data is not lost, even if the source and
destination blocks overlap.
Example
STRING .dst[0:499];
STRING .vals[0:9] := "repeat me ";
INT len := 10;
INT num := 50;
!vals is stored 50 times.
CALL RTL_Memory_Repeat_( dst, vals, len, num );
PROC RTL_Memory_Repeat_(dest, values, values_len, num_rep );
STRING .dest; ! out
STRING .values; ! in
INT values_len; ! in
INT num_rep; ! in TNS
only
PROC RTL_Memory_RepeatX_(dest, values, values_len, num_rep);
STRING .EXT dest; ! out
STRING .EXT values; ! in
INT(32) values_len; ! in
INT(32) num_rep; ! in TNS
only