English
Language : 

NSB8 Datasheet, PDF (75/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
STRING FUNCTIONS
LEN (<string name>)
Returns the current length of the string held in the string variable named as the argument.
If A$=”CAT” then LEN(A$) will be equal to 3. If A$="" then LEN(A$) will return 0
CHR$ (<numeric expression>)
The CHR$ function returns a one character string as its value. The argument value (in decimal)
specifies the ascii character code for the character to be returned in the string. Note that the argument
to CHR$ can be any integer in the range of 0 to 255.
CHR$(65)=”A”, CHR$(97)=”a”, CHR$(32)=” “ (space) and so on
ASC (<sring constant, string variable, or substring reference>)
Returns a numeric value, the numeric ascii code of the first character contained in the argument. The
argument must not be the null string. Note that CHR$ and ASC are inverse functions.
ASC(“B”)=66, ASC(“CLUNK”)=67
VAL (<string expression>)
Converts the value of the string expression to a number and returns that number as its value. If the
expression doesn’t evaluate to a legal numeric constant, then a program error occurs. Leading blanks
are ignored. Note that if any non numeric characters follow the numeric constant which is at
beginning of the string expression, they will be ignored.
VAL(“123”) = (the number) 123, VAL(“00000”)=0, VAL(“abcde”), VAL(“ “) and VAL(“ “)
will cause errors, VAL(“123XYZ”)=123, VAL(“XYZ123”) causes an error.
STR$ (<numeric expression>)
This is the inverse function of VAL: it converts the numeric value of its argument into a string
representation of that number and returns that string as the function value. The format of the string
depends upon the default format as specified in a PRINT statement (i.e., free format if no previous
PRINT statement has specified a default format). See statement PRINT and section PRINT
FORMATTING for further details.
SPECIALIZED INPUT OUTPUT FUNCTIONS
INCHAR$ (<numeric expression>)
This function will await the typing of a single character at the input device specified by number in
the numeric expression. The character will be returned as a single character string. Control
characters as well as printing characters will be returned. <control-C> will be returned only if
<control-C> program interruption has been disabled (see section CONTROL-C, THE PANIC
BUTTON). The character will not be echoed by BASIC (printed on the terminal when its key is
pressed). Assuming device 0 is the system console and device 1 is a remote terminal, then
INCHAR$(0) will return a single character typed at the console, and INCHAR$(1) will return one
character typed at the remote location. The following short program will fetch an individual
character from the console terminal and will echo it on that terminal’s screen:
10 T$=INCHAR$(0) \ REM Get the character …
20 PRINT T$, \ REM and echo it.
NSB8
Rel. 5.10
Page 63