• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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