Posts: 728
Threads: 109
Joined: May 2015
Reputation:
0
Is there a mistake if i write new string[755] for example?
or it has to be 128,256,524... ?
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
String sizes don't have to be 128, 256, etc. Y Less actually wrote a topic about this, but my repost of it got deleted for whatever reason. You still shouldn't use a large amount of cells unless you need it. Having more cells slows down the compiler, and can waste memory.
Posts: 232
Threads: 4
Joined: Apr 2013
I never say don't use string sizes like 128, 256, 512 etc.
Use the lowest size that is really required, I have a "new string[2000];" in my script and I really need it! No body can says that is wrong, but this number is the size that is allocated in your memory, and remember "new string[2000];" will allocate 8000 (2000 * 4) bytes from your memory which is actually a lot and it can cause problem when your script is big.
Also check out packed strings, if you use packed strings with a size of 2000, it will allocate only 2000 bytes of your memory.
Posts: 728
Threads: 109
Joined: May 2015
Reputation:
0
Ok guys got it,thank you .