Yes, you can.
local static: When using 'static' on a lower level (like you did) it's value will be remembered.
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.
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);
}
}
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.