CRE Programmer's Guide

String and Memory Block Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
8-22
Strncat
i := RTL_Strlen_(s); ! i gets 7
Strncat
The Strncat functions concatenate not more than a specified number of characters
from one string to another.
first
is a pointer to the string to which the second string is concatenated.
second
is a pointer to the string that is concatenated to the first string.
max_bytes
specifies the maximum number of characters from second to concatenate to
first. max_bytes must be a positive number.
Return Value
The Strncat functions return the address of the resulting string, @first.
Considerations
Both first and second must be terminated by a zero (null) byte to stop the scan.
You must ensure that there are enough bytes at the end of first to accommodate
max_bytes additional bytes.
The functions append a null byte to the result.
Example
STRING .fir[0:100] := ["Front",0];
STRING .sec[0:100] := ["Back",0];
STRING .temp;
! @temp gets @fir
INT PROC RTL_Strncat_( first, second, max_bytes );
STRING .first; ! out
STRING .second; ! in
INT max_bytes; ! in TNS
only
INT(32) PROC RTL_StrncatX_( first, second, max_bytes );
STRING .EXT first; ! out
STRING .EXT second; ! in
INT(32) max_bytes; ! in TNS
only