Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 122

Advertising
background image

Operating Functions

Chapter 5

5–85

5.10.3.7
Insert String in a String – CALL 66

This routine inserts a string within another string. The call expects three
arguments. The first argument is the position at which to begin the insert.
The second argument is the string number of the characters inserted into
the base string. The third argument is the string number of the base string.
This routine has no return arguments.

u10 REM SAMPLE ROUTINE TO INSERT A STRING IN A STRING

u20 STRING 500,15

u30 $(0)=“1234590”

u40 $(1)=“67890”

u50 PRINT “BEFORE: 0$=”,$(0)

u60 PUSH 6 :REM POSITION TO START THE INSERT

u70 PUSH 1 :REM STRING NUMBER OF THE STRING TO BE INSERTED

u80 PUSH 0 :REM BASE STRING NUMBER

u90 CALL 66 :REM INVOKE INSERT A STRING IN A STRING

u91 REM :REM ROUTINE

u100 PRINT “AFTER: 0$=”,$(0)

u110 END
uRUN

BEFORE: 0$=1234590
AFTER: 0$=1234567890
READY

5.10.3
String Support Calls
(continued)

Advertising