beautypg.com

ProSoft Technology MVI56-BAS User Manual

Page 152

background image

BASIC CALLs Syntax

MVI56-BAS ♦ ControlLogix Platform

User Manual

BASIC Module (DB/BAS Compatible)

Page 152 of 234

ProSoft Technology, Inc.

December 13, 2011

CALL 65: Replacing a String in Another String

CALL 65 replaces a string in another string:

PUSH [A]
PUSH [B]
PUSH [C]
CALL 65

Where:
A = string number that will replace string B in string C
B = string number that will be replaced by string A
C = string number that will have substring B replaced by string A

Example:

Ready
>list
10 STRING 100, 20
20 $ ( 0) = "Red-lines"
40 $ ( 1) = "Red"
50 $ ( 2) = "Blue"
60 PRINT "Before:"
70 PRINT "$(0) = ", $ ( 0)
80 PUSH 2, 1, 0: CALL 65
90 PRINT "After:"
100 PRINT "$(0) = ", $ ( 0)
110 END
Ready
>run
Before:
$(0) = Red-lines
After:
$(0) = Blue-lines
Ready
>