VAL()

Syntax:

val!(<string ptr str>) |  val(<string ptr str>) | val%(<string ptr str>)

The VAL() function tries to parse the numeric value in a string pointed by str to the numeric type of the function.

Parsing rules for VAL!()

The VAL!() function will return 0 if:

  • The argument points to an empty string
  • The string is longer than 3 characters
  • The string contains any non-numeric character, including a space
  • The numeric value exceeds 255

Parsing rules for VAL()

The VAL() function will return 0 if:

  • The argument points to an empty string
  • The string is longer than 6 characters
  • The string contains any non-numeric character, except for the first character which can be a minus sign (-)
  • The numeric value is less than -32768 or greater than +32767

Parsing rules for VAL%()

The VAL%() function is hardwired to the equivalent function in BASIC ROM, please refer to this page for parsing rules.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies

Discussion

Enter your comment. Wiki syntax is allowed: