Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Advantage CA-Clipper Guide v6.11 - ax_exprvalid() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 AX_ExprValid()
 Verify if expression can be evaluated by the Advantage Expression Engine
------------------------------------------------------------------------------

 Syntax

     AX_ExprValid( <cExpression> ) -> logical

     <cExpression> Expression string to check for use by Advantage
     Database Server Expression Engine.

 Returns

     Returns a true value (.T.) if expression can be evaluated by the
     Advantage Expression Engine on the server.  Returns a false (.F.) if
     expression cannot be evaluated on the server.

 Description

     Advantage can perform certain CA-Clipper operations, such as index
     creation and SET FILTERs, completely on the server using Advantage's
     Expression Engine.  The Advantage Expression Engine supports most
     legal CA-Clipper expressions.  Advantage does have some limitations,
     however, as to what index and filter expressions can be handled on the
     server.  For instance, if an index key expression contains a memory
     variable or UDF, Advantage will not build the index on the server,
     but on the client instead.

     Building indexes on the server is much faster than on the client.  You
     may want to verify that the index expressions contained in the index
     can be handled on the server before you actually try to build the
     index.  This can be accomplished by sending down the expression in the
     AX_ExprValid() function.  If .T. is returned, the expression can be
     handled on the server.  If .F. is returned, it cannot.  If .F. is
     returned, the user can check the return code of AX_ExprError() to find
     out more information about why the expression cannot be evaluated on
     the server.

 Example

     local cMemVar := 24

     USE test VIA "DBFNTXAX"

     ? AX_ExprValid( "lastname + firstname" ) // Returns .T.
     ? AX_ExprError()                         // Returns error code 0
                                              // indicating that no error
                                              // occurred.

     ? AX_ExprValid( "empid + cMemVar" )      // Returns .F.
     ? AX_ExprError()                         // Returns error code 3411
                                              // indicating the expression
                                              // contained a memory variable


See Also: AX_ExprEngine() AX_ExprError()

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