• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] StringHash like hashtable id

Status
Not open for further replies.
Level 17
Joined
Nov 13, 2006
Messages
1,814
it doesn't save anything
JASS:
set i = 0
l = StringLength(*string*)
loop
exitwhen i == l
   set s = SubString(udg_SL_STRING, i, i + 1)
   call SaveInteger(udg_SL_HASHTABLE, 1, StringHash(s), i)
   if s == "c" then
     call DisplayTextToPlayer ( GetLocalPlayer(), 0, 0, s+":"+I2S(i)+" in hash"+I2S(LoadInteger(udg_SL_HASHTABLE, 1, StringHash(s)))+" sid:"+I2S(StringHash(s)))
   endif
   //call SaveStr(h, 2, i, s)
set i = i + 1
endloop
 
Last edited by a moderator:
Level 17
Joined
Nov 13, 2006
Messages
1,814
call SaveInteger(udg_SL_HASHTABLE, 1, StringHash(s), i)
You saved integer there ^)^ Oh, you are saving the integer. My bad.

Then it's probably because the condition doesn't met?
if s == "c" then

save is outside of if block, i insert if only if check its loaded well the string, and yes because got it the "c" char, and i = 38 when its got the c but not saved to hashtable

[edit]

sorry at hashtable init was something bad in another trigger sorry for thread
 
Status
Not open for further replies.
Top