Saving as hex (reading with sscanf 2.0) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Saving as hex (reading with sscanf 2.0) (
/showthread.php?tid=137897)
Saving as hex (reading with sscanf 2.0) -
RSX - 30.03.2010
I consider some giant values saving as hex.. would that optimise speed along with files and array sizes?
Main example for everyone :
Money lets say as max can be(as max amount that can be saved.. althought maybe i will use it as "unsigned" by adding 31(-1) bit int all the time)
or
difference - 2 charaters for file and array is now free.
Reading example :
Код:
sscanf("Money 7FFFFFFF","{s}h",Player money);
Currently writing with hexadecimal...
Written with hexadecimal.. no problems found to date.
Re: Saving as hex (reading with sscanf 2.0) -
RSX - 31.03.2010
Can anyone give atleast theoretical answer?
Re: Saving as hex (reading with sscanf 2.0) -
Dabombber - 31.03.2010
I doubt there will be any noticeable difference in speed, test it if you want. File size isn't important either, 2 characters are nothing with current hard drive sizes and array sizes will be the same. Just use whatever makes the most sense, for money it would be integers.