4. System Classes : Scope Class : CreateDynExpr Method
 
Share this page                  
CreateDynExpr Method
The CreateDynExpr method creates a dynamic expression on a specified scope object.
This method has the following syntax:
DynExpr = Scope.CreateDynExpr(string = string [, errors = byref(StringObject)])
This method has the following parameters:
string
Represents a syntactically valid OpenROAD expression. The string is evaluated within the context of the named scope. Identifiers appearing within the string must also be defined in a symbol table associated within the scope. The string cannot contain any invocations of procedures or methods. There are no other restrictions on the expression.
errors
Specifies that compilation errors should be returned
When this method is invoked on a scope, the DynExpr object created is usable only for the lifetime of the scope. If the scope represents an event block, field script, frame, or procedure, then any attempt to use the DynExpr object after the event block, field script, frame, or procedure terminates causes a runtime error.
If the specified context is invalid, or if the specified string cannot be compiled, the CreateDynExpr method returns a null. To obtain a listing of the compilation errors, specify the optional errors parameter. If compilation errors occur, the CreateDynExpr method creates a string object containing the errors and sets the variable specified by the errors parameter to point to that string object. If no compilation errors occur, the CreateDynExpr method sets the variable specified by the error parameter to null.
For more information about using this method, see How You Can Create a Dynamic Expression and How You Can Get Values from Unknown Fields in the Programming Guide.