If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
2021-06-15, 11:36 PM (This post was last modified: 2021-06-15, 11:36 PM by Kwarde.)
Yes, you can.
local static: When using 'static' on a lower level (like you did) it's value will be remembered.
Code:
myCode()
{
for (new i; i < 10; i)
{
static x;
x;
printf("%i", x);
}
}
This would print "1" up to "10". If you would use "new x;" it would print "1" 10 times.
global static: When using 'static' on highest level (outside any function, eg. near your includes) it means that variable may only be used in that file.
const: constant. When declaring a variable as a constant it cannot be altered. Eg. if you'd try to use format() or simply setting the value of your string in your example, it would not compile.