Actually, I should apologize for not mentioning I was not having a code problem, which is how most people stumble upon bugs, but if you would just spend your time on politics, instead of trying to help people, this wouldn't be an issue! :D
Anyway, yesterday when I was testing the code I did substitute in REDIM SHARED testarray(1 TO 100), the same thing you came up with, just to be sure it was the STATIC keyword that was messing up the RUN and CLEAR statements, and it was.
@powers that be:
I did check the WIKI, and if RUN and CLEAR have had other issues, why hasn't someone placed these in a known issue thread?
http://qb64.org/wiki/Main_Page#Known_issuesUnder the WIKI RUN statement, it does mention these:
RUN should reset the RANDOMIZE sequence to the starting RND function value.(Not in QB64)
Note: Qbasic also allowed /RUN in a command line call to run a BAS file with the interpreter. QB64 cannot run BAS files!
Note: RUN causes a stack leak in QB64 if it is called from within a SUB or FUNCTION. Avoid when possible!
NOTE: Not available in Linux or Mac operating systems.
If anyone is still updating the WIKI, maybe STATIC should be added. Also, if the "Known Issues" will not be including all known issues, maybe consider adding something like: Check keywords in the WIKI for known issues with particular QB64 statements.
Pete