E
eskgwin
I have an RWHashDictionary that I am inserting keys and values into. I
really need duplicate keys, but I know that I can't have them. This is
what I am going to do instead:
RWCollectableString* key1;
RWCollectableString* val1;
key1 = new RWCollectableString(wholemeas); //wholemeas is an RWCString
that contains values like ABCEF and RGGEF and TREEF)
The first problem I am encountering is where the user wants to put
ABCEF in as a key with the value of CT0 and ABCEF in as a key with
a value of PN0. I know I can't do that in a hash dictionary so I am
going to add a :# (# will come from a loop and be distinct) to the end
of each key before adding it to the dictionary.
The second problem I am encountering is getting these key/value pairs
back out. I only know the ABDEF part and not the :1, :2, etc. part
of the key. I don't even know if there are any :1, :2, etc. keys in
the dictionary.
Is there a way to do a substring on the key to get all the key/values
back out of the dictionary without exactly knowing the keys? I can't
find a way to do it and maybe I need to change this to something that
can take duplicates. But then I have another problem, when trying to
get them out one at a time. If I am searching on the key, how will it
know which value to get?
If you understand what I am trying to do, thanks. And thanks for any
help.
Allyson
really need duplicate keys, but I know that I can't have them. This is
what I am going to do instead:
RWCollectableString* key1;
RWCollectableString* val1;
key1 = new RWCollectableString(wholemeas); //wholemeas is an RWCString
that contains values like ABCEF and RGGEF and TREEF)
The first problem I am encountering is where the user wants to put
ABCEF in as a key with the value of CT0 and ABCEF in as a key with
a value of PN0. I know I can't do that in a hash dictionary so I am
going to add a :# (# will come from a loop and be distinct) to the end
of each key before adding it to the dictionary.
The second problem I am encountering is getting these key/value pairs
back out. I only know the ABDEF part and not the :1, :2, etc. part
of the key. I don't even know if there are any :1, :2, etc. keys in
the dictionary.
Is there a way to do a substring on the key to get all the key/values
back out of the dictionary without exactly knowing the keys? I can't
find a way to do it and maybe I need to change this to something that
can take duplicates. But then I have another problem, when trying to
get them out one at a time. If I am searching on the key, how will it
know which value to get?
If you understand what I am trying to do, thanks. And thanks for any
help.
Allyson