Table of Contents

19.8.0 Eval component and Eval() function

If you turn to the subject, you will discover on the one hand the function Eval() and on the other hand the component Eval (gb.eval) with its 3 classes. The connection is not immediately obvious, but using the properties of the Expression (gb.eval) class and its Compile method accomplish the same thing as the Eval() function.

19.8.0.1 Component Eval gb.eval

You can use this component to evaluate Gambas expressions at runtime. It contains the classes:

The description of the properties, methods and constants of the last two classes can be found in chapters 19.8.3 and 19.8.4.

19.8.0.2 Eval() function

When you call this function Eval(..) to evaluate Gambas expressions at runtime, the gb.eval component is automatically loaded:

Value = Eval ( Expression AS String [ , Context AS Collection ] ) AS Variant

Download