Partilhar via


FOXEVAL( ) Function

Evaluates a Visual FoxPro expression from an application that allows .dll calls.

nExprLen = FOXEVAL(cExpression, cBuffer, nLen)

Return Values

Integer

Parameters

  • cExpression
    The Visual FoxPro expression to evaluate.
  • cBuffer
    Where to store the value of the Visual FoxPro expression.
  • nLen
    The length of cBuffer.

Remarks

Returns the length of the string stored in cBuffer if successful; -1 otherwise.

You need to pass the cBuffer argument by reference rather than by value for Visual FoxPro to be able to store a value in the buffer. In Visual FoxPro, for example, declare the function with @ after the second string. Arguments are passed by reference by default in Word Basic.

Because there is no way to create and read a buffer in a Help file macro, this function is not useful as a registered routine in Help.

Example

*In Visual FoxPro
DECLARE integer FOXEVAL in (MYDLL) ;
   string, string @, integer 
cBuff = SPACE(100)
=FOXEVAL("TTOC(DATETIME())", @cBuff, 100)
?cBuff

See Also

Fpole.dll | Fpole.dll Examples | FOXDOCMD( ) | SETERRMODE( ) | SETOLEOBJECT( ) | CLOSEIT( ) | GETLASTERR( )