EDIT: This post is outdated because the initialization is now included in the full example above.
And don't forget: It is dangerous/buggy to define global vars for RTE functions at global script level like it was usual all the time:
...
global RTE_myVar = 0
...
since no such variable without appended index will exist any more, and the really existing ones remain undefined.
To stay indeppendent from number of instances, maybe better style to define inside RTE, after check that they're undefined:
Code:
GScriptClip("""
...
try { __ = RTE_myVar%%%%%% } catch(err) { global RTE_myVar%%%%%% = 0 }
...
first use of RTE_myVar%%%%%% in RTE
...
""", local=true)
If you know what you do, you may define a whole bunch in one catch block (faster), or you may check each var separately.