PxConfigNextString

Gamma/Photon: Using Gamma™ with the Photon microGUIŽ, Version 4.0
Prev |  | Next

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

## See Also

In Photon documentation: PxConfigNextString.

Prev | Home | Next
`PxConfigNextSection` | Up | `PxConfigOpen`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.