KRASCHE
&
BYRNE
         ELZED  HOME       NEWS       DOCS       DOWNLOADS       LICENSING       SUPPORT       FAQ       ABOUT  US

What's An Elzed?
Features
Licensing
Downloads
Documentation
Elzed News
    ELZED 
 Documentation 
 The Details 
 API 

lzReadExpOp

The lzReadExpOp function establishes a new expression-based operator.

long lzReadExpOp(
   char cScope,   // the scope of the new operator
   const char* szOperatorName,   // the scope of the new operator
   const char* szOperatorType,   // the type of the new operator
   const char* szReturnType,   // the type of the value returned
   const char* szParmList,   // the list of operator parameters
   const char* szPrecedenceOp,   // an operator with the same precedence
   const char* szFilePathName   // the path to the expression file
);

Parameters

cScope
   A character code indicating the scope of the new operator. The character code must be one of the following values:

Code
Constant
Meaning
'C'
kCosmicScope
Available in all contexts
'G'
kGlobalScope
Available in current context only


szOperatorName
   A null-terminated character string containing the name of the new expression-based operator. Must be unique within the indicated scope.

szOperatorType
   A null terminated string containing the type of the new expression-based operator. Four type value constants are provided for your use:

Type Value
Constant
Meaning
"prefix"
kOpPrefix
Operator before parms, like 'tan' or 'abs'
"infix"
kOpInfix
Operator between parms, like '+' or '='
"postfix"
kOpPostfix
Operator after parms (rare), like post-increment '++'
"nofix"
kOpNofix
Operator without parms, like 'true' and 'pi'


szReturnType
   A pointer to a null-terminated character string containing the return type.
An Elzed expression operator may return one of the following types:

Type
Description
number
a double precision numeric value
string
a null-terminated character string
boolean
a char value equal to zero (FALSE) or the current value representing boolean TRUE
void
no return value


szParmList
   A string list of parameter type/name pairs separated by commas.
The following parameter types are allowed:

Type
Description
number
a double precision numeric value
string
a null-terminated character string
boolean
a char value equal to zero (FALSE) or the current value representing boolean TRUE

Parameter types and names are case sensitive.
If the proposed operator has no parameters, szParmList should be NULL.

szPrecedenceOp
   A character string containing an operator symbol. When successfully defined, the new expression operator will have the same precedence as this operator.

szFilePathName
   A character string containing the path to the text file containing the expression which will be evaluated when the new operator is invoked. For recursive or circular definitions, this parameter will be NULL.

Return Value

   Returns an Elzed error code. If the operator is successfully defined, returns "No Error". Returns a non-zero Elzed error code if not successful. Call lzGetLastErrorText to determine the reason for the failure.

Remarks

   Available in both Visual C++ and Visual Basic.

Parameters passed to expression operators are considered to be at "local" scope. This means that parameters with the same names as variables at global or cosmic scope will effectively hide those variables. They will not be accessable within the operator expression.

Complete recursive and circular operator definitions with a call to lzDefineExpOpStr.

Versions

   Introduced in Elzed 1.0.0
Modified in Elzed 2.3.1 -- "current list separator" is now "comma"
Modified in Elzed 2.4.0 -- String (char*) parameters are now declared const.
   This page describes the version of lzReadExpOp active in Elzed 2.5.0 (222: 2.5.0)

See Also



  Copyright  ©  MMXXV  by  R R Le Cropane   •   All Rights Reserved   •   Terms of Use   •   Privacy Policy