Condividi tramite


_PutValue( ) API Library Routine

Writes the value val at the output position in the current output window.

void _PutValue(Value FAR *val)
Value FAR *val;            /* Value to display. */

Example

The following example uses _PutValue( ) to display its Character-type parameter in uppercase on the screen.

Visual FoxPro Code

SET LIBRARY TO PUTVALUE
= XUPPER("upper")  && displays "UPPER" on screen

C Code

#include "pro_ext.h"

void NullTerminate(Value FAR *cVal)
{
   if (!_SetHandSize(cVal->ev_handle, cVal->ev_length + 1))
   {
      _Error(182); // "Insufficient memory"
   }
   ((char FAR *) _HandToPtr(cVal->ev_handle))[cVal->ev_length] = '\0';
}
FAR Example(ParamBlk FAR *parm)
{
   char FAR *pString;
   int i;

   NullTerminate(&parm->p[0].val);
   pString = _HandToPtr(parm->p[0].val.ev_handle);
   for (i = 0; i < parm->p[0].val.ev_length; i++)
   {
      if ('a' <= *pString && *pString <= 'z')
      {
         *pString += ('A' - 'a');
      }
      pString++;
   }
   _PutValue(&parm->p[0].val);
}

FoxInfo myFoxInfo[] = {
   {"XUPPER", (FPFI) Example, 1, "C"},
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also

Reference

_PutChr( ) API Library Routine

_PutStr( ) API Library Routine

_WPutChr( ) API Library Routine

_WPutStr( ) API Library Routine

Other Resources

API Library Construction

Accessing the Visual FoxPro API