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.2 . Technical Reference - <b>_itemputc()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _itemPutC()
 Place a zero-terminated character value into an Item
------------------------------------------------------------------------------
 C Prototype

     #include "item.api"
     ITEM _itemPutC(
                     ITEM itemChar,
                     BYTEP fpChars
                   )

 Arguments

     itemChar is the Item into which you want to place the string.  If
     itemChar is NULL, _itemPutC() will create a new Item.

     fpChars is the zero-terminated string to place into the Item.

 Returns

     A new Item reference containing the zero-terminated string passed.

 Description

     The _itemPutC() function is used to associate a zero-terminated string
     with an Item.  Any previous value in itemChar will be destroyed.

     The data located at fpChars is copied into a new space associated with
     the Item that is returned.  It is the programmer's responsibility to
     free the allocation of fpChars in whatever manner it was allocated.

     Note:  _itemPutC() must copy the intended string from your buffer at
     fpChars.  If fpChars is unusually large, _itemPutC() may cause a VM
     failure due to insufficient real memory to accomplish a large copy.
     Typically, this error would manifest itself as an internal error 5302.

     Caution!  Do not assume that the address in itemChar will be the
     same address returned by _itemPutC().

 Examples

     /*
     *  YesNo( lExpr ) -> cValue
     *
     *  Given a logical expression, returns the
     *  string "Yes" if true, and "No " if false.
     *
     */

     CLIPPER YesNo( void )
     {
        ITEM itemParam, itemCRet;

        // Warning: DGROUP!

        itemCRet = _itemPutC( NULL, "No " );

        if (PCOUNT > 0)
        {
           itemParam = _itemParam( 1 );
           if (_itemGetL( itemParam ))
              itemCRet = _itemPutC( itemCRet, "Yes");

           _itemRelease( itemParam );
        }

        _itemRelease( _itemReturn( itemCRet ) );
        return;
     }

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


See Also: _itemGetC() _itemPutCL()

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