Remote-processing BASIC 52 Instrukcja Użytkownika Strona 31

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 163
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 30
RPBASIC-52 PROGRAMMING GUIDE
2-12
CHR
Syntax: CHR(expr)
CHR( string, positi on)
Where: expr = number from 0 to 255
string = string variable
position = 1 to length of string
Function: Converts expr to ASCII character or prints string at position
Mode: Command, run
Use: PRINT CHR (65)
PRINT CH R($(0),1)
Cards: All
DESCRIPTION
CHR is a dual use ope rator, similar to AS C. One version converts a numeric expression to an ASCII
character, allowing a variety of string manipulation operations. The second version uses CHR to print
individual ch aracte rs in an A SCII s tring. expr is a decimal number and truncates numbers from 0 through
65535. There must be no space between C HR and the left pa renthe ses or an AR RAY SIZ E error results .
Although expr can be any integer, printable AS CII characters range from 20 H through 7EH (32 through 127).
The STR function may be used to m anipulate and print longer portions of strings.
RELATED
ASC, STR, STRING
ERRORS
BAD ARGUMENT expr can't be truncated to an integer (0 through 65535)
ARRAY SIZE space between CHR and left parentheses
EXAMPLE
10 STRING 200,20
20 $(1)="1234567890"
30 FOR N=64 TO 80
40 PRINT CHR(N),
50 NEXT
60 PRINT
70 FOR N=1 TO 9
80 PRINT CHR($(1),N),
90 NEXT
RUN
@ABCDEFGHIJKLMNOP
1234567890
Przeglądanie stron 30
1 2 ... 26 27 28 29 30 31 32 33 34 35 36 ... 162 163

Komentarze do niniejszej Instrukcji

Brak uwag