PxConfigOpen (cfgfile, mode)
A configuration file.
One or more of these flags: PXCONFIG_READ| PXCONFIG_WRITE|PXCONFIG_CREATE.
This function opens the cfgfile according to the mode specified. If the PXCONFIG_CREATE flag is set for the mode, the PXCONFIG_WRITE flag must be set as well.
This example, ex_PxConfigOpen.g, and its configuration file (configtest.txt) are included in the product distribution. A copy of the configtext.txt configuration file is shown in the PxConfigRead reference page.
#!/usr/cogent/bin/phgamma o = PxConfigOpen("configtest.txt", PXCONFIG_READ); princ(o,"\n"); princ(int_p('a'), "\n"); princ("PxConfigReadInt : ",PxConfigReadInt("Section One", "LineOne", 0),"\n"); princ("PxConfigReadLong : ",PxConfigReadLong("Section One", "LineTwo", 0),"\n"); princ("PxConfigReadShort : ",PxConfigReadShort("Section One", "LineThree",0),"\n"); princ("PxConfigReadChar : ",PxConfigReadChar("Section Two", "LineTwo", 'x'),"\n"); princ("PxConfigReadString : ",PxConfigReadString("Section Two", "LineTwo", "nothing", 14),"\n"); princ("PxConfigReadString : ",PxConfigReadString("Section Two", "LineThree", "nothing", 14),"\n"); c = PxConfigClose(); princ(c,"\n");
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.