NAME

val - convert string to numeric value

SYNOPSIS

#include <basic/string.h>

double val(s)
struct string *s;

DESCRIPTION

Val returns a value converted from the string pointed to by s.  The conversion is performed with atobasic(io).  The string is expected to begin with a properly formatted BASIC numeric constant.  The string may contain any other characters beyond this point provided they do not appear to be part of the constant.  The characters interpreted are only those which are appropriately formatted. 

This function implements the BASIC VAL function. 

SEE ALSO

string(inc), atobasic(io)
val(func)

DIAGNOSTICS

Zero is returned if a properly formatted numeric constant is not present at the beginning of the string. 

Error 6 (Overflow) is generated if the value would overflow (a double). 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber