Raised This Month: $ Target: $400
 0% 

[Help]CellTrie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lightokun
Member
Join Date: Oct 2009
Old 11-28-2010 , 20:01   [Help]CellTrie
Reply With Quote #1

So, i have arrays "ArrayCont","ArrayData"
I put in ArrayData key, like:
Code:
TrieSetCell(ArrayData, "key", 123);
Then i put ArrayData in ArrayCont:
Code:
TrieSetCell(ArrayCont, "some_key", ArrayData);
What happens when i try to rewrite a key in ArrayData, like this?
Code:
new AD
TrieGetCell(ArrayCont, "some_key", AD)
TrieSetCell(AD, "key", 321);
It will add a new key and there will be two keys "key" or it'll rewrite "key" value "123" to value "321"?
__________________

Last edited by Lightokun; 11-28-2010 at 20:01. Reason: title
Lightokun is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-28-2010 , 21:03   Re: [Help]CellTrie
Reply With Quote #2

Why don't you just try it out?
__________________
fysiks is offline
Lightokun
Member
Join Date: Oct 2009
Old 11-28-2010 , 21:15   Re: [Help]CellTrie
Reply With Quote #3

TrieGetCell(AD, "key", keyvalue);
Returns value of keyvalue, so i guess it rewrites the value. But i don't know for real and i don't know how to check it.
__________________
Lightokun is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-28-2010 , 22:05   Re: [Help]CellTrie
Reply With Quote #4

I'm quite sure it's not possible to have two keys that are identical in the same Trie.
__________________
fysiks is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-28-2010 , 22:13   Re: [Help]CellTrie
Reply With Quote #5

I didn't understand one thing you were trying to do.
Quote:
Originally Posted by Lightokun
So, i have arrays
Tries are not arrays.
If you say you have arrays, we assume they are cellarrays or normal arrays.
Also, Trie handles need to be tagged with Trie.

If you are going to ask if your code works, we are going to say test yourself.
If you need help coding something, then post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lightokun
Member
Join Date: Oct 2009
Old 11-28-2010 , 22:19   Re: [Help]CellTrie
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
I didn't understand one thing you were trying to do.

Tries are not arrays.
If you say you have arrays, we assume they are cellarrays or normal arrays.
Also, Trie handles need to be tagged with Trie.

If you are going to ask if your code works, we are going to say test yourself.
If you need help coding something, then post.
Meh, nevermind. It's deep morning here and i'm in editor for ~7 hours, so i can do mistakes.
The question was how function handles some queryes, if it was posted somewhere i wouldn't ask here.
SetCell/String rewrites keys values. Thx for help.
__________________
Lightokun is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-29-2010 , 01:10   Re: [Help]CellTrie
Reply With Quote #7

A key is unique.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode