Condividi tramite


_RetInt( ) API Library Routine

Sets the library return value to a numeric value.

void _RetInt(long ival, int width)
long ival;                     /* Long integer value. */
int width;                     /* Number of columns to display number. */

Remarks

The width parameter specifies the number of columns Visual FoxPro uses when displaying the number. If you don't know the width, use 10.

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example performs some operations on the table open in the current work area. It displays the value returned by _RecCount( ).

Visual FoxPro Code

SET LIBRARY TO RETINT  
? CTEST()

C Code

#include  <pro_ext.h>
#define nl _PutChr('\n')

long FAR CTest()
{
   long rc,rec;
   int workarea = -1;
   int flag = 0;
   int rn,recn;

   rc = _DBRewind(workarea);
   _PutStr("top");  nl;
   rc = _DBSkip(workarea, 5);
   _PutStr("skipped 5");  nl;
   
   rc = _DBAppend(workarea,flag);
   _PutStr("Appending"); nl;
   rc = _DBRewind(workarea);
   _PutStr("top");  nl;
   rn = _DBRecCount(workarea);
   _RetInt(rn, 10);
   rec = rn;
   return rn;
}

FoxInfo myFoxInfo[] = {
   {"CTEST", (FPFI) CTest,0 , ""},
};
FoxTable _FoxTable = {
   (FoxTable FAR *)0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo
};

See Also

_RetChar( ) API Library Routine | _RetCurrency( ) API Library Routine | _RetDateStr( ) API Library Routine | _RetDateTimeStr( ) API Library Routine | _RetFloat( ) API Library Routine | _RetLogical( ) API Library Routine | _RetVal( ) API Library Routine