Name
Val -- convert a string to a number
Synopsis
var, chrs = Val(string$)
Function
Converts the specified string into a number. If the string does not start with a number, 0 will be returned. The string can also contain hexadecimal numbers starting with a "$".

Starting with Hollywood 2.0 you can also pass a string which contains a binary number to this function now. Simply prefix it with a '%' character. Additionally, a second value is returned now which specifies how many characters Val() has read from the string. This allows you to determine the length of the number.

Inputs
string$
string to convert to number
Results
var
variable that receives the converted number
chrs
number of characters converted
Example
result, chrs = Val("500 people were on the train.")
Print(result, "-", chrs)
This will print "500-3" to the screen.

Show TOC