Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Technical Reference - <b>_evallaunch()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _evalLaunch()
 Call CA-Clipper code blocks from C
------------------------------------------------------------------------------
 C Prototype

     #include "item.api"
     ITEM _evalLaunch(
                       EVALINFOP evalInfoP
                     )

 Arguments

     evalInfoP is a properly set EVALINFO structure (as set by _evalNew()
     and _evalPutParam()).

 Returns

     The item that is the result of the evaluation.

 Description

     The _evalLaunch() function allows you to call any code that can be
     defined in a code block from C.  Note also that you may call a
     particular symbol by name if you pass a character string item to
     _evalNew() when creating the EVALINFO structure.

     _evalLaunch() requires a EVALINFO structure properly initialized via
     _evalNew() with parameters placed in the structure via _evalPutParam().
     Failure to follow this protocol exactly will result in catastrophe.

     During the process of launching an evaluation, the Item API creates new
     item references for each item placed in the parameter list.  After an
     _evalLaunch() call is made, you must call _evalRelease() to individually
     release all of the references, or the items used as parameters will
     never be released from object memory for the garbage collector.

 Examples

     /*
     * USERDO()
     * --------
     */

     CLIPPER userDO( void )
     {
        EVALINFO info;
        USHORT   uiParam;
        ITEM     retP;

        /* Get evaluation expression */

        if ( PCOUNT < 1 )
        {
           _ret();
           return;
        }
        else
        {
           _evalNew( &info, _itemParam( 1 ) );
        }

        /* Get parameters */

        for ( uiParam=2; uiParam <= PCOUNT; uiParam++ )
        {
           _evalPutParam( &info, _itemParam(uiParam) );
        }

        /* Launch evaluation information */

        retP = _evalLaunch( &info );

        /* Release ITEMs associated w/eval info */

        _evalRelease( &info );

        _itemReturn ( retP );
        _itemRelease( retP );

        return;
     }

 Files  Library is CLIPPER.LIB, header file is Item.api.


See Also: _evalNew() _evalPutParam() _evalRelease()

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