Function _conSetCWArea() Foundation

Set new workarea and return the numeric identifier of the old workarea.

Syntax
XPPAPIRET _conSetCWArea(char *newWArea,
                        int *oldWArea);
Parameters
CHAR* newWArea
The character pointer newWArea points to a character string identifying the new workarea.
int* oldWArea
The address of an integer variable that is to contain the numeric identifier of the old workarea.
Return

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

Description

This function is used to set a new workarea using its alias name.

Examples
#include <windows.h> 

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


XPPRET XPPENTRY MyCAPIFunction(XppParamList paramList) 
{  /* Declare and initialize variables */ 
int iOldWArea; 

if(_conSetCWArea( "DB1", &iOldWArea )) 
{ /* Error handling... */ 
} 

_retnl( paramList, (LONG)iOldWArea ); 
} 

/* Xbase++ code */ 
PROCEDURE Main 
LOCAL aDb1Struct := { {"NR",    "C",  5, 0}, ; 
                      {"NAME",  "C", 30, 0}  } 
LOCAL aDb2Struct := { {"NR",    "C",  5, 0}, ; 
                      {"PHONE", "C", 30, 0}  } 

CLS 

DbCreate( "DB1", aDb1Struct ) 
DbCreate( "DB2", aDb2Struct ) 

USE DB1 NEW EXCLUSIVE 
USE DB2 NEW EXCLUSIVE 

? Select(), Alias() 

? MyCAPIFunction() 

? Select(), Alias() 
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.