Call 67: delete string from a string – Rockwell Automation 1771-DB BASIC MODULE User Manual

Page 256

Advertising
background image

Chapter
Call Routines 0–68

12

12 -66

Use this routine to delete a string from within another string.

Important: This routine deletes only the first occurrence of the string.

Input and Output Arguments

This routine has two input arguments and no output arguments. The first
argument is the base string number. The second is the string number of the
string you want to delete from the base string.

Syntax

PUSH

base string number

PUSH

string number of string to be deleted from base string

CALL 67

Example

>10 REM ROUTINE TO DELETE A STRING IN A STRING

>20 STRING 200,14

>30 $(1)=“123456789012”

>40 $(2)=“12”

>50 PRINT “BEFORE: $1=”,$(1)

>60 PUSH 1 :REM BASE STRING NUMBER

>70 PUSH 2 :REM STRING NUMBER OF STRING TO BE DELETED

>80 CALL 67: REM INVOKE STRING DELETE ROUTINE

>90 PRINT “AFTER: $1=”,$(1)

>100 END

>RUN

BEFORE: $1=123456789012

AFTER: $1=3456789012

CALL 67: Delete String
from a String

Advertising