SA-MP Forums Archive
Do a "static" variable stay on the memory until the script stops? - 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)
+--- Thread: Do a "static" variable stay on the memory until the script stops? (/showthread.php?tid=486664)



Do a "static" variable stay on the memory until the script stops? - Cameryn - 09.01.2014

I have some global static variables as well as some local ones. I want to know if both of them stays on the memory for as long as the server is running.


AW: Do a "static" variable stay on the memory until the script stops? - Nero_3D - 09.01.2014

As long as you don't do a gmx / restart


Re: AW: Do a "static" variable stay on the memory until the script stops? - Cameryn - 09.01.2014

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
As long as you don't do a gmx / restart
Okay. But a "new" variable get destroyed after it leaves it's scope right?


AW: Do a "static" variable stay on the memory until the script stops? - Nero_3D - 09.01.2014

Yes, just read pawn-lang.pdf (page 60++) or just press the second subject on the left "Data and declarations"