String Operations. Commodore 4.0
Werbung
Werbung
1.8.5 String Operations
Strings may be concatenated using +. For example:
10 A$="FILE" : B$="NAME"
20 PRINT A$ +
B$
+ A$ +
B$
FILENAME
NEW FILENAME
Strings may be compared using the same relational operators that are used with numbers:
String comparisons are made by taking one character at a time from each string and comparing the ASCII codes. If all the ASCII codes are the same, the strings are equal. If the ASCII codes differ, the lower code number precedes the higher. If, during string comparison, the end of one string is reached, the shorter string is said to be smaller. Leading and trailing blanks are significant. Examples:
"AA" "AB„
"FILENAME" = "FILENAME"
,.
X$
„ > ..X#"
"CL " > "CL"
" kg
" < "
KG
"
"SMYTH" < "SMYTHE"
B$ < "9/12/78" where B$ = "8/12/78"
19
Herunterladen
Werbung