15 lines
1.2 KiB
Text
15 lines
1.2 KiB
Text
Input "Enter a text or a number: ", v$ 'The "$" establishes that this is a string variable. So whatever entered will be stored as
|
|
'a string.
|
|
If v$ = Str$(Val(v$)) Then 'Str$() converts numeric values to their string counter parts and Val() does the opposite,
|
|
'converting strings to their numerical values. By converting the value of whatever is stored
|
|
'in v$ to a number and then back to a string it will have either stayed completely the same,
|
|
'in which case it is a numeric value (including exponent and hex and oct based numbers) or
|
|
'what is returned by the nested Str$() and Val$() functions will be different, in which case
|
|
'one, the other, or both returned an error or a truncation of the original string which began
|
|
'with numeric characters but was not entirely a number, such as "99, rue de Rivoli".
|
|
Print "Your entered a number."
|
|
Else
|
|
Print "You did not enter a number."
|
|
End If
|
|
Sleep
|
|
System
|