Function _conSetCurrentField() Foundation

Assign the value of a container to a field variable of the current workarea.

Syntax
XPPAPIRET _conSetCurrentField(CHAR *field,
                              ContainerHandle chValue);
Parameters
CHAR* field
The character pointer field contains the name of the Xbase++ field variable.
ContainerHandle chValue
The handle of a container that holds the value that is to be assigned to the field variable.
Return

This function returns NULL if no error occured, otherwise it returns an error code (XPP_ERR_...).

Description

The function _conSetCurrentField() is used to assign a new value to a field variable of the current workarea.

Examples
#include <windows.h> 

#include "xppdef.h" 
#include "xpppar.h" 
#include "xppcon.h" 

XPPRET XPPENTRY MyCAPIFunction(XppParamList paramList) 
{ 
ContainerHandle chName  = _conGetCurrentField( "NAME",  NULLCONTAINER ); 
ContainerHandle chPhone = _conGetCurrentField( "PHONE", NULLCONTAINER ); 

/* Now swap name and phone number... */ 

if(_conSetCurrentField( "NAME", chPhone )) 
{ 
   /* Error handler... */ 
} 

if(_conSetCurrentField( "PHONE", chName )) 
{ 
   /* Error handler... */ 
} 
} 


/* Xbase++ code */ 
PROCEDURE Main 
LOCAL aStruct := { { "NAME",  "C", 30, 0 }, ; 
                   { "PHONE", "C", 30, 0 }  } 
CLS 

DbCreate( "PHONELIST", aStruct ) 

USE PHONELIST NEW EXCLUSIVE 

APPEND BLANK 
PHONELIST->NAME  := "XENIA B." 
PHONELIST->PHONE := "+49 6196 9572-0" 

? "NAME :", PHONELIST->NAME 
? "PHONE:", PHONELIST->PHONE 

MyCAPIFunction() 

? "NAME :", PHONELIST->NAME 
? "PHONE:", PHONELIST->PHONE 

CLOSE DATABASES 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.