View Single Post
Leech_v2
Senior Member
Join Date: Mar 2011
Location: Chinese GuangDong
Old 10-07-2023 , 04:03   Re: What is the difference in the way these variables are declared?
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
"new" just creates a new variable of local scope. If it's used on the top-level, it's effectively a global variable with respect to the plugin's own code. When declared in this scope, there is no runtime execution happening so only constant expressions are allowed. When you create a variable in a local scope that is processed at runtime (like inside of a function) then you can initialize it with any normal code.

"new", "static", and "public" are mutually exclusive expressions so I'm not sure why you have any combination of those. References:
Because in actual testing, 'new' can be combined with 'public', 'static', and 'stock'.
That's why I have questions
Leech_v2 is offline