"David N. Welton" wrote:
 
> The best solution I've found is still the use of two variables: the
> array ::request::VARS for the variables and the list
> ::request::VARSLISTS for the variable names assigned more than a
> time (like I suggested with last email).

> Not perfect, though... nobody else has suggestions?

It's not perfect, but it is better than arbitrary seperators.

We could also use the Tcl "hash of hashes" hack, although I don't like
it much:

$VARS(x,1) == "value 1"
$VARS(x,2) == "value 1"
$VARS(x,3) == "value 1"
 

I don't like it, too. If you use:

    puts $::request::VARS(x)

it keeps failing. (we could also set $VARS(x)="{value 1}{value 2}{value 3}",
but this way we replicate everything two times..)

 
Maybe VARSLISTS could contain some useful information, like the length
of the list.  Actually, if we were to do that, all variables could
have one, and you would just check if it's > 1.  I kind of like that,
as > 1 is easier that [ info exists blahblah ], which gets tiring if
you use it a lot.
 
If VARSLIST is just the list of the variables which are defined
more than once, one can simply...

foreach vname $::request::VARSLISTS {
   ...process the list $vname...
}

A script should always check if the variable exists before using it;
there's no way to avoid [info exists $::request::VARS(x)] if you want your
script to handle gracefully an error condition when x is not set.
 

 
--
David N. Welton
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/
         Work: http://www.innominate.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
****************************************************************************
            "Life's not fair, but the root password helps."
 


Reply via email to