String array sizes
#1

Hi,
I just have a simple question:

Why some coder stop their strings size to [256].. i use to stop mine at [300], is that why my script is sometimes unstable?

thanks
Reply
#2

I recommend string sizes 128 or lower. 300 is way too much and in-efficient for your script.

The string size means how many characters/letters are going to be in your string/message. You can always use at least [50] for small text strings, but remember: if a player's name and id with a message all appear in one string/line, I would recommend a bigger string size, like 128, not 50.

300 is useless, in-efficient and uses up a lot of computer resources.
Reply
#3

In this case,256 = cells,In Other Words,if you define 256,you can use 256 letters.

You can use this: http://projogos.com.br/GeradoresJFS/GeradorCelula.html to count the you letters,to not wasting cells.
Reply
#4

Obviously defining smaller string arrays will reduce memory usage. It will not change cpu usage.

To answer the original question, the number 256 is a nice round number in coding terms because it is 2 ^ 8 or
2x2x2x2x2x2x2x2 = 256

This does not make it in any way a better default size for string arrays
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=55261
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)