val() -- converts a string to a number
The val-function checks, if the start of its string argument forms a floating point number and then returns this number. The string therefore has to start with digits (only whitespace infront is allowed), otherwise the val-function returns zero.
input "Please enter a length, either in inches (in) or centimeters (cm) " l$
if (right$(l$,2)="in") then
print "You have entered ",l,"cm."
This example queries for a length and checks, if it has been specified in inches or centimeters. The length is then converted to centimeters.