Call 67 – delete a string in a string, Call 67 – delete a string in a string -9, Purpose – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 251: Syntax, Example

Advertising
background image

Publication 1746-RM001A-US-P

String Functions 15-9

CALL 67 – Delete a
String in a String

Purpose

Use CALL 67 to delete a string from within another string. The CALL expects two
arguments. The first argument is the base string number. The second is the number
of the string deleted from the base string. This routine has no output arguments.

Syntax

PUSH [base string number]
PUSH [deleted string number]
CALL 67

Example

>1

REM EXAMPLE PROGRAM

>10

REM ROUTINE TO DELETE A STRING IN A STRING

>20

STRING 200,14

>30

$(1) = “123456789012”

>40

$(2) = “12”

>50

PRINT “BEFORE:”

>60

PRINT “$(1) = ”,$(1)

>70

PUSH 1 : REM BASE STRING NUMBER

>80

PUSH 2 : REM STRING NUMBER OF THE STRING DELETED

>90

CALL 67 : REM INVOKE STRING DELETE ROUTINE

>100 PRINT “AFTER:”

>110 PRINT “$(1) = ”,$(1)

>120 END

READY

>RUN

BEFORE:

$(1) = 123456789012

AFTER:

$(1) = 3456789012

READY

>

IMPORTANT

This routine deletes only the first occurrence of the string.

Advertising