PxConfigNextString (maxlen)
This function gets the next entry in the current configuration file section. This is useful for processing entries whose names may not be known. If the function is called at the end of a section, it returns nil. A subsequent call will get the first entry of the next section.
This example, ex_PxConfigNext.g, is included in the product distribution.
#!/usr/cogent/bin/phgamma op = PxConfigOpen("configtest2.txt", PXCONFIG_READ); princ("\nOpened? (0 = no, -1 = yes): ", op,"\n"); princ("PxConfReadString results: ",PxConfigReadString("Section One", "LineOne", "nothing", 14),"\n"); princ("PxConfigNextString results: ", PxConfigNextString(5),"\n"); princ("PxConfigNextString results: ", PxConfigNextString(5),"\n"); princ("PxConfigNextString results: ", PxConfigNextString(5),"\n"); a = PxConfigSection("Section Three"); princ("\nPxConfigSection results: ", a, "\n"); princ("PxConfigNextString results: ", PxConfigNextString(10),"\n"); princ("PxConfigNextString results: ", PxConfigNextString(10),"\n"); princ("\nPxConfigNextSection results: ", PxConfigNextSection(),"\n"); princ("PxConfigNextString results: ", PxConfigNextString(20),"\n"); princ("PxConfigNextString results: ", PxConfigNextString(20),"\n"); princ("\nPxConfigNextSection results: ", PxConfigNextSection(),"\n"); cl = PxConfigClose(); princ("Closed? (0 = no, -1 = yes): ", cl,"\n\n");
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.