10-26-2022, 07:15 PM
(10-26-2022, 04:24 PM)bplus Wrote: Don't understand the use of STATIC in this sub. Static should be used to preserve values between calls to the Sub.I have disliked using "DIM" if not for arrays, so I would use an alternative to declare variables if it exists, because I also dislike making an entire subprogram "STATIC". This is related to "_DEFINE A-Z AS LONG" on top of the program or not making any difference in program performance on 64-bit. I used to write that statement before I got ahold of "OPTION _EXPLICIT". I'm going to hang on to integers most of the time although you and @Pete were only two people convincing me that it doesn't matter a lot at this point what is the "default" numeric variable.
Remember I also program in Lua, in that one directly from the developers must use "local" inside a function to protect variables that are to be used only inside that function, otherwise they are global. I gave that link because there are variations of Lua floating around (such as RENOISE scripting device) that compel an "OPTION _EXPLICIT" mode and have more OOP features.