Pm designer operation manual, String operation – B&B Electronics WOP-2121V-N4AE - Manual User Manual
Page 449

14
PM Designer Operation Manual
14-40
CHAPTER 14 USING MACROS
14.4.17. String Operation
STRCPY
Format
STRCPY(P1, P2 )
Function
Copies the string in P2 to P1.
P1 (I)
The byte array that receives a copy of the string in P2. The byte array must be large enough to
hold the string and the null terminator.
P2 (I)
The source, i.e. the byte array that contains the null-terminated string to be copied.
Example 1
$U10
=
“ABCDE”
STRCPY(
$U20
,
$U10
)
After the command STRCPY is executed, the byte array $U20 contains the string “ABCDE” and
the memory content is like the following:
Word
Low Byte
High Byte
$U20 'A'
'B'
$U21 'C'
'D'
$U22 'E'
0
Example 2
$U10
=
“12”
STRCPY(
$U20
,
$U10
)
After the command STRCPY is executed, the byte array $U20 contains the string “12” and the
memory content is like the following:
Word
Low Byte
High Byte
$U20 '1'
'2'
$U21 0
Undefined
STRCAT
Format
STRCAT(P1, P2 )
Function
Appends string in P2 to string in P1.
P1 (I)
The byte array that contains a null-terminated string to which the command appends P2. The byte
array must be large enough to hold both strings and the null terminator.
P2 (I)
The byte array that contains a null-terminated string to be appended to the string in P1.
Example 1
$U10
=
“ABC”
$U20
=
“12345”
STRCAT(
$U10
,
$U20
)
/* After this command is executed, the byte array $U10 contains
“ABC12345” */
Example 2
$U100
=
“C:\MyFolder\”
$U130
=
“Test”
$U140
=
“.txt“
STRCAT(
$U100
,
$U130
)
STRCAT(
$U100
,
$U140
)
/* After this command is executed, the byte array $U100 contains
“C:\MyFolder\Test.txt” */