Previous Topic

Next Topic

SwitchCtree

Switch to a specific c-tree Plus instance.

Short Name

SWTCTREE()

Type

Low-level function

Declaration

COUNT SwitchCtree(pTEXT regid)  

Description

SwitchCtree() makes the instance identified by the supplied registration reference name regid active.

Note: regid is case sensitive and must be exactly the same value previously passed to RegisterCtree.

Return

Value

Symbolic Constant

Explanation

0

NO_ERROR

Instance successfully switched.

516

GNUL_ERR

ctNOGLOBALS not allocated.

517

GNOT_ERR

regid is not registered.

See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values.

Example

TEXT     inpbuf[128] = "myInstance"; /* input buffer */

if (SwitchCtree(inpbuf)) {
    ctrt_printf("\nCould not SWITCH to {%s} instance.",inpbuf);
    ctrt_exit(2);
}

See also

NextCtree(), RegisterCtree(), UnRegisterCtree(), WhichCtree()