Remote Processing Coorporation RPC-320 Dokumentacja Strona 101

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 186
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 100
Commands - 71
MID$
String Statement
SYNTAX: MID$(a$,s [,n]) = b$
PURPOSE: To replace a portion of one string with another.
REMARKS: A common usage for the MID$ statement is in networking protocols. The network commands are
standard strings defined by string variables.
Using the MID$ statement to modify these strings is much faster than other string methods.
The string a$ is the target string, while b$ is the replacement string.
The parameter s is the starting point within a$ where b$ will be inserted. The optional parameter n
indicates how many characters of b$ are to be used. When n is omitted, all of b$ is used.
If b$ is longer than a$, replacement will not exceed the length of a$. No error message will be
given.
RELATED: LEFT$, LEN, RIGHT$, INSTR, MID$ Function
EXAMPLE: 10 F$ = "Hopeless"
20 R$ = "Help"
30 MID$(F$,1) = R$
40 PRINT F$
Helpless
The example below is for a communications protocol. Note that the escape character is not a
printable character.
10 CV$=CHR(27) + "A" + "12"
20 MID$(CV$,3) = "23"
30 PRINT CV$
ESC A23
ERROR: <Data negative>– for s and n
<Data out of range> – if s = 0
<Data > 255> – for s and n
Przeglądanie stron 100
1 2 ... 96 97 98 99 100 101 102 103 104 105 106 ... 185 186

Komentarze do niniejszej Instrukcji

Brak uwag