User`s guide
Chapter
5
BASIC
Commands
39
Syntax
A$ = STR$(N%)
Remarks
"A$" is a string variable to be assigned to the result.
"N%" is a numeric expression.
Example
String$ = STR$(123)
UCASE$
Purpose
To return a copy of a string in which all lowercase letters will be converted to
uppercase letters.
Syntax
A$ = UCASE$(X$)
Remarks
"A$" is a string variable to be assigned to the result.
"X$" may be a string variable, string expression, or string constant.
Example
String1$ = "John Thomas"
String2$ = UCASE$(String1$)
' String2$ = "JOHN THOMAS"
VAL
Purpose
To return the numeric value of a string expression in long integer form.
Syntax
A& = VAL$(X$)
Remarks
"A&" is an integer/long integer variable to be assigned to the result.
"X$" is a string that includes numeric characters. If the first character is not
numeric, VAL function returns 0. The VAL function will strip leading blanks, tabs,
and linefeeds from the argument string. The return numeric value is in the range of -
2,147,483,648 to 2,147,483,647.
Example
ON HOUR_SHARP GOSUB OnHourAlarm
...
OnHourAlarm:
Hour% = VAL(LEFT$(TIME$,2))
FOR Counter% = 1 TO Hour%
BEEP(800,50)
WAIT(200)
NEXT
RETURN