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 gamma_ph_#_examples_1_QNX4.tgz file available on the Cogent Web Site. A copy of the configtext.txt configuration file is shown in the PxConfigRead reference page.
#!/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");