Mailing List Archive



Back to the month index Back to the list index

David J. Hughes (bambi@Hughes.com.au)
Wed, 7 Apr 1999 15:33:39 +1000 (EST)


Date: Wed, 7 Apr 1999 15:33:39 +1000 (EST)
From: "David J. Hughes" <bambi@Hughes.com.au>
Subject: Re: Lite / Form Question
Message-ID: <Pine.BSF.3.96.990407152733.518O-100000@fawn.hughes.com.au>

I've thought of a solution for the variable dereferncing problem that will
work in Lite 2.0. Remembering that the problem is extracting the value of
a variable when you know the name of the variable. So, if you have
something like 10 variables called $form_X where X is between 1 and 10 you
could use

        $count = 1;
        while( $count < 11)
        {
                $varName = "$form_$count";
                $varValue = expandText($varName);
                echo("$varName = '$varValue'\n');
                $count++;
        }

You will always get it back as a char value rather than the native type of
the value but it will work _if the variable exists_. If it doesn't then
you'll get a value of "$form_1" or whatever returned.

Wierd, but workable.

Bambi
...