www.digitalmars.com         C & C++   DMDScript  

D - Next question....

reply Terry Bayne <gnome hiwaay.net> writes:
Is it possible to initialize an associative array of strings?

I tried a couple of things but I haven't been able to make it work.

For example I tried the following:

alias char[] str;
str[str] X = ["TEST":"TEST1"];

Which does not work.

In fact I didn't have much luck getting associative arrays of strings to 
work at all.

Thanks,
Terry
Jul 23 2003
parent "Walter" <walter digitalmars.com> writes:
There is currently no way to statically initialize an associative array.
You'll need to load it up with explicit assignment statements.

"Terry Bayne" <gnome hiwaay.net> wrote in message
news:Xns93C1A45D32CD4tbaynehiwaaynet 63.105.9.61...
 Is it possible to initialize an associative array of strings?

 I tried a couple of things but I haven't been able to make it work.

 For example I tried the following:

 alias char[] str;
 str[str] X = ["TEST":"TEST1"];

 Which does not work.

 In fact I didn't have much luck getting associative arrays of strings to
 work at all.

 Thanks,
 Terry

Jul 28 2003