• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

String Length

Status
Not open for further replies.
I mean you can test it by yourself and you will be 100 % sure of the answer, nothing else.

Also playing with strings when you're not supposed to use them, is not a really good idea in jass, because it's likely you will have many strings "leaks".
And you can't do anything about that, excepted avoid them.
 
JASS:
local integer i = 0
local string s = ""
local hashtable h = InitHashtable()
loop
     call SaveStr(h,0,0,I2S(1 x (10 ^ i)))
     set s = LoadStr(h,0,0)
     if S2I(s) <= 0 then
          call DebugMsg(I2S(i))
          exitwhen true
     endif
     set i = i + 1
endloop

Just run this and you have your answer. could always put set i = i + 10, 50, 100, etc. if it lags too bad. Also, you have to fix (10 ^ i), not at WE atm so i cant remember the function
 
Nes already created a "super pimp multi-dimensional arrays with ubersauce"-system (actual Nes-quote), Catalog.
Strings are indeed slow though (and they also leak :P).

Well, that would be hard for me; Nes is a smart guy that makes smart and strange systems so I am always having difficulties using his systems which is really frustrating for a someone like me :vw_sad:.
 
Status
Not open for further replies.
Back
Top