beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 153

background image

MVI56-BAS ♦ ControlLogix Platform

BASIC CALLs Syntax

BASIC Module (DB/BAS Compatible)

User Manual

ProSoft Technology, Inc.

Page 153 of 234

December 13, 2011

CALL 66: Inserting a String in Another String

CALL 66 inserts a string within another string:

PUSH [A]
PUSH [B]
PUSH [C]
CALL 66

Where:
A = position number in string C
B = string number that will be inserted in string C
C = string number where string B will be inserted

Example:

Ready
>list
10 STRING 100, 15
20 $ ( 0) = "1234590"
30 $ ( 1) = "67890"
40 PRINT "Before:"
50 PRINT "$(0) = ", $ ( 0)
60 PUSH 6, 1, 0: CALL 66
70 PRINT "After:"
80 PRINT "$(0) = ", $ ( 0)
Ready
>run
Before:
$(0) = 1234590
After:
$(0) = 123456789090
Ready
>