ProSoft Technology MVI56-BAS User Manual

Page 147

Advertising
background image

MVI56-BAS ♦ ControlLogix Platform

BASIC CALLs Syntax

BASIC Module (DB/BAS Compatible)

User Manual

ProSoft Technology, Inc.

Page 147 of 234

December 13, 2011

9.5

String CALLs

This section describes the string manipulation commands. Remember that before

using any command listed in this section you will have to allocate memory space

for strings using the STRING command which is defined below.
Before referencing strings or using any string commands you must initially
allocate memory space for string usage. The

STRING

command should be used in

order to allocate memory space for strings:

STRING [A],[B]

Where:
A = total number of bytes to be allocated
B = maximum number of bytes to be allocated for each string
The MVI56-BAS requires an extra byte for each string and an additional

overhead byte. So, "10 STRING 100, 10" would allocate enough space for 9

strings (11 bytes each plus one more byte is 100 bytes) with no space to spare.

CALL 60: Repeating a Character

In order to repeat a character in a string use CALL 60:

PUSH [A]
PUSH [B]
CALL 60

Where:
A = number of times
B = string number that contains one character

Example:

Ready
>list
10 STRING 200, 40
20 $ ( 1) = "*"
30 PUSH 40, 1: CALL 60
40 PRINT $ ( 1)
50 END
Ready
>run
****************************************
Ready
>

Advertising