Rockwell-automation 1771-DB BASIC MODULE Manuel d'utilisateur Page 254

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 394
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 253
Chapter
Call Routines 0–68
12
12 -64
Use this routine to replace a string within a string.
Input and Output Arguments
This routine has three input arguments and no output arguments. The first
input argument is the string number of the new string to replace the old
string. The second input argument is the string number of the old string to
be replaced by the new string. The third input argument is the base string’s
string number.
Syntax
PUSH string number of the replacement string
PUSH
string number of the string to be replaced
PUSH
base string number
CALL
65
Example
>
10 REM SAMPLE OF REPLACE STRING IN STRING
>
20 STRING 1000,20
>
30 $(0)=“RED-LINES”
>
40 $(1)=“RED
>
50 $(2)=“BLUE”
>
60 PRINT “BEFORE: $0=”,$(0)
>
70 PUSH 2 :REM STRING NUMBER OF STRING TO REPLACE WITH
>
80 PUSH 1 :REM STRING NUMBER OF STRING TO BE REPLACED
>90
PUSH 0 :REM BASE STRING NUMBER
>
100 CALL 65 :REM REPLACE STRING IN STRING ROUTINE
>1
10 PRINT “AFTER: $0=”,$(0)
>1
20 END
>RUN
BEFORE: $0=RED-LINES
AFTER: $0=BLUE-LINES
CALL
65: Replace a String
in a String
Vue de la page 253
1 2 ... 249 250 251 252 253 254 255 256 257 258 259 ... 393 394

Commentaires sur ces manuels

Pas de commentaire