Function _conSetMemvar() Foundation

Assign the value of a container to an Xbase++ memvar.

Syntax
XPPAPIRET _conSetMemvar(CHAR *name,
                        ContainerHandle chValue);
Parameters
CHAR* name
The character pointer name contains the name of the Xbase++ memvar.
ContainerHandle chDest
Handle of a container that contains the value that will be assigned to the Xbase++ memvar.
Return

This function returns NULL if no error occured, otherwise it returns an error code which can be checked by _conLastError().

Description

The function _conSetMemvar() is used to assign the value of a container to an Xbase++ memvar. If this memvar does not already exist, it will be created by the function.

Examples
#include <windows.h> 

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

XPPRET XPPENTRY MyCAPIFunction(XppParamList paramList) 
{  /* Declare and initialize variables */ 
ContainerHandle chValueA = _conGetMemvar( "VALUEA", NULLCONTAINER ); 
ContainerHandle chValueB = _conGetMemvar( "VALUEB", NULLCONTAINER ); 

/* Now swap values. */ 
_conSetMemvar( "VALUEA", chValueB ); 
_conSetMemvar( "VALUEB", chValueA ); 

/* Release containers. */ 
_conRelease( chValueA ); 
_conRelease( chValueB ); 
} 


/* Xbase++ code */ 
PROCEDURE Main 
PUBLIC ValueA := 1 
PUBLIC ValueB := 2 

CLS 
? ValueA, ValueB 

MyCAPIFunction() 

? ValueA, ValueB 
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.