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 - aofvartostring() http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 aofVarToString()
 Converts a variable to an equivalent string constant
------------------------------------------------------------------------------

Syntax

     aofVarToString( <xValue> ) -> character value

     <xValue>  Value to be converted to its string constant equivalent.

Returns

     Returns the string constant equivalent of the given value.

Description

     The aofVarToString() function allows you to sensibly use local or
     static variables within a filter expression.

     Local and static variables cannot be referenced directly because
     there is no way for Client AOF to associate the symbol name with its
     value.  However, aofVarToString() provides a straight-forward means of
     working around this limitation by converting the value to an
     equivalent string constant which can be concatenated together as
     part of the filter expression string.

Example

     LOCAL cStr := "Advantage is cool"
     LOCAL dDate := ctod( "01/28/69" )
     LOCAL lLogical := .F.
     LOCAL nValue := 26.4

     ? aofVarToString( cStr )          // "Advantage is cool"
     ? aofVarToString( dDate )         // ctod( '01/28/69' )
     ? aofVarToString( lLogical )      // .F.
     ? aofVarToString( nValue )        // 26.4

     USE customer INDEX age, dob

     aofSetFilter( "age >= " + aofVarToString( nValue ) )
     LIST age

     aofSetFilter( "dob < " + aofVarToString( dDate ) )
     LIST dob


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