Hummm...
I wonder if your data structure is a bit off.
Instead of an array of strings and string_bool values,
perhaps you should do
one of a couple things:
1) Have an array of strings, then a corresponding array of
booleans
2) Have a hashTable instead of an arrayList. If you know all
the strings by
name, why not use that. It's like using a struct in CF (if
you've used
structures before). It's sort of like an array, except that
you don't index
them by number, but by name (the string). Then the strings
would be boolean
values... hmm. let's visualize:
Hashtable stuff = new Hashtable();
stuff.add("mystring1", true);
stuff.add("mystring2", false);
MessageBox.show(stuff.mystring1.toString()); // will pop up
the message
"true"
And of course you can loop over it with a foreach loop
because it's
enumerable.
Now i'm not 100% on this, but it *should* work ;) Hope that
helped.
-nathan strutz
http://www.dopefly.com/
On 8/1/06, Tom Donovan <Tom.Donovan acm.org> wrote:
>
> > Semantics question.
> >
> > I've got an arraylist and I want to populate the
arraylist with a host
> > of string names, and a boolean value. The boolean
value will be a
> > variable whose name will be dependent on the
string name.
> >
> > So for instance, lets say the string value is
"myString", the name of
> > the boolean variable would be
"myString_boolean". I have a finite set
> > of strings, and I know all of
them...."myString", "myString2",
> > "myString3", etc.
> >
> > My question is, is there a simple way to evaluate
the boolean value
> > "myStringX_boolean", where myStringX
will need to be evaluated first.
> > In CF, the evaluate function would work. Is there
an equivalent in .
> > NET, or is there a better way to do this sort of
thing?
> >
> > TIA,
> >
> > Brian
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages
of hard-hitting,
up-to-date ColdFusion information by your peers, delivered
to your door four times a year.
http://www.f
usionauthority.com/quarterly
Archive: http://www.houseoffusion.com/groups/Net-T
alk/message.cfm/messageid:3084
Subscription: http://www.houseoffusion.com/groups/Net-Talk/subscribe
.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/u
nsubscribe.cfm?user=22184.15789.44
|