English
Language : 

NSB8 Datasheet, PDF (93/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
“Z” > “COCOA”
“123” < “124”
“123” < “ABC”
“ABC” < “abc”
“ABC” > “AB”
“120” < “75”
“AB ” > “AB”
“AB1” > “AB01”
“,”>“!“
NOTE:
The logical operators AND, OR and NOT may not be used to combine the effects of two or more
string comparisons in an IF statement. These three operators may be used in numeric comparisons
only.
ASSIGNMENT TO STRINGS AND SUBSTRINGS
Any legal string expression may be assigned to a string variable or any part of a variable (by the use
of substring notation), as in the following examples:
A$=”CAT”
Q7$(1,3)=”DOG”
In the second example, note that the first three characters of Q7$ will become “DOG”. Any
characters in Q7$ past the third will not be changed.
If a string value is assigned to a string variable which has been dimensioned to be too small to hold
the entire value, its rightmost characters are discarded until the resulting truncated value will fit in
the variable. Similarly, if an assigned value is too big to fit in a substring interval, it is truncated to
the proper length. As an illustration, try running the following program:
10 REM Demonstration of automaticstring truncation in assignment.
100 DIM L$(13)
110 L$=”ABCDEFGHIJKLMNOPQRSTUVWXYZ”
120 PRINT L$
130 L$(2,3)=”12345”
140 PRINT L$
The output of the program looks like this:
ABCDEFGHIJKLM
A12DEFGHIJKLM
The value shown on the first line of output is a result of the assignment statement in program line
110. Although the attempt was made to assign the entire alphabet to L$, only the first 13 characters
fit, due to the dimension declared for L$ in line 100. The rest of the alphabet was discarded.
The second output line shows the value produced by the assignment in line 130. The assignment asks
that a five character string value be squeezed into a two character interval, which is not possible. As
a result, BASIC assigned only the first two characters of “12345”, or “12” to the substring, ignoring
the rest.
When assigning to a substring interval, if the value assigned is smaller in length than the substring
interval, any remaining characters in that interval are not modified, as in the following example
program:
NSB8
Rel. 5.10
Page 81