ComponentOne Sizer 8.0
Val Property

Returns the value of the expression in the Line property.

Syntax

val# = [form!]C1Awk.Val

Remarks

This property evaluates the mathematical expression in the L (line) property and returns its value as a double. The expression may contain variables, provided you handle the Variable event.

The following operators are supported, according to their priority:

Operator

Meaning

()

subexpressions

^

power

*, /

multiplication, division

%

modulus (remainder)

\

integer divide

+, -

addition, subtraction

>; >=; <; <=; <>

logical comparison

&, |

logical "and", logical "or"

In addition to the standard operators, the following built-in functions are supported (they are not case sensitive): Abs, Sin, Cos, Tan, ACos, ASin, Atn, Log, Log10, Exp, Sqr, Int, Frac, Ceil, and Floor. Trigonometric functions accept and return angles expressed in radians or degrees, depending on the setting of the AngleUnits property .

The Awk expression evaluator allows you to define your own variables. This is done in a very simple way. Whenever the parser encounters a string that is not a number, operator, or built-in function, it fires the Variable event. The event handler gets the variable name and is responsible for returning its value.

If an error occurs while evaluating an expression, the Error property is set to an appropriate code. See the description of the Error property to find out what each code means.

For example:

Example Title
Copy Code
awk = "(1+2)*3^2"
debug.print awk.Val
27

Data Type

Double

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback