Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>val()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
VAL()


Syntax:     VAL(<expC>)

Purpose:    To convert numbers contained in a character expression to a
            numeric value.

Argument:   <expC> is a character expression to convert.

Returns:    A numeric value.

            VAL() stops evaluating a character expression when a second
            decimal point, the first non-numeric character, or the end
            of the expression is reached.

Usage:      VAL() is useful when you want to do calculations using
            numbers contained in a character expression.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   SET DECIMALS TO 2
   SET FIXED ON

   ? VAL("12.1234")           && Result: 12.12
   ? VAL("12.1256")           && Result: 12.13
   ? VAL("12A12")             && Result: 12.00
   ? VAL("A1212")             && Result: 0.00
   ? VAL(SPACE(0))            && Result: 0.00
   ? VAL(SPACE(1))            && Result: 0.00
   ? VAL(" 12.12")            && Result: 12.12
   ? VAL("12 .12")            && Result: 12.00


See Also: SET DECIMALS SET FIXED STORE STR() SUBSTR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson