
Remarks
If the "condition" is true, loop statements are executed until the WEND statement is
encountered. Then the program execution returns to the WHILE statement and
checks the condition again. If it is still true, the process will be repeated. Otherwise,
the execution continues with the statement following the WEND statement.
Example
WHILE TRANSACTION_COUNT > 0
Data$ = GET_TRANSACTION_DATA$(1)
WRITE_COM(1,Data$)
DEL_TRANSACTION_DATA(1)
WEND
5.4 Commands for String Processing
This section describes BASIC commands used to manipulate sequences of ASCII
characters known as strings. In BASIC, strings are always variable length, from null to a
maximum of 250.
5.4.1 Combining Strings
Two strings can be combined with the plus operator " +". The string following the plus
operator is appended to the string preceding the plus operator. For example,
...
Data$ = DATE$ + TIME$ + EmployeeID$
SAVE_TRANSACTION(Data$)
...
5.4.2 Comparing Strings
Two strings can be compared with the relational operators, see section 4.3.3. A single
character is greater than another character if its ASCII value is greater.
For example, the ASCII value of the letter "B" is greater than the ASCII value of the letter
"A", so the expression "B" > "A" is true.
When comparing two strings, BASIC looks at the ASCII values of corresponding
characters. The first character where the two strings differ determines the alphabetical order
of the strings. For example, the strings "aaabaa" and "aaaaaaaa" are the same up to the
fourth character in each, "b" and "a". Since the ASCII value of "b" is larger than that of "a",
the expression "aaabaa" > "aaaaaaaa" is true.
Comentários a estes Manuais