Call 61: string append (concatenation) – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 250

Advertising
background image

Chapter
Call Routines 0–68

12

12 -60

Use this routine to append one string to the end of another string.
If the resulting string is longer than the maximum string length, the append
characters are lost. This is a string concatenation assignment.
(Ex. $(1)=$(1)+$(2)).

Input and Output Arguments

This routine has two input arguments and no output arguments. The first
input argument is the string number of the string you want appended.
The second input argument is the string number of the base string.

Syntax

PUSH

string number of string to be appended

PUSH

string number of the base string

CALL 61

Example

>10 STRING 200,20

>20 $(1)=”How are ”

>30 $(2)= “you?”

>40 PRINT “BEFORE:”,

>50 PRINT “$1=”,$(1),” $2=”,$(2)

>60 PUSH 2 :REM STRING NUMBER OF STRING TO BE APPENDED

>70 PUSH 1 :REM BASE STRING NUMBER

>80 CALL 61 :REM INVOKE STRING CONCATENATION ROUTINE

>90 PRINT “AFTER:”,

>100 PRINT “$1=”,$(1),” $2=”,$(2)

>110 END

>RUN

BEFORE:

$1=How are

$2=you?

AFTER:

$l=How are you?

$2=you?

CALL 61: String Append
(Concatenation)

Advertising