Call 61 – string append, Call 61 – string append -2, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 244: Purpose, Syntax

Advertising
background image

Publication 1746-RM001A-US-P

15-2 String Functions

Example

>1

REM EXAMPLE PROGRAM

>10 REM STRING REPEAT EXAMPLE PROGRAM

>20 STRING 200,48

>30 $(1) = “*”

>40 PUSH 40 : REM THE NUMBER OF TIMES TO REPEAT CHARACTER

>50 PUSH 1 : REM BASE STRING NUMBER

>60 CALL 60

>70 PRINT $(1)

>80 END

READY

>RUN

****************************************

READY

>

CALL 61 – String Append

Purpose

Use CALL 61 to append one string to the end of another string. This CALL
expects two string arguments. The first is the string number of the string to be
appended and the second is the string number of the base string. If the resulting
string is longer than the maximum string length, the append characters are lost.
There are no output arguments. This is a string concatenation assignment:
(example:

$(1)=$(1)+$(2)

).

Syntax

PUSH [string number to be appended]
PUSH [base string number]
CALL 61

IMPORTANT

If the new string length exceeds the length allocated by the string
command, an error message is printed on the console device and
the module enters Command mode.

Advertising