• 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.

String Length

Status
Not open for further replies.
Level 17
Joined
Apr 27, 2008
Messages
2,455
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.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
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
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
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.
Top