PxConfigNextString

PxConfigNextString — gets the next entry in the current section.

Syntax

PxConfigNextString (maxlen)

		

Arguments

maxlen

The maximum length of the string to return.

Returns

A dotted list with the format (EntryName . Value), or nil.

Description

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.

Example

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");


See Also

In Photon documentation: PxConfigNextString.