I come from a programming background and something has been kinda
been bothering me about AFL.
Why even have StaticVarGet() and StaticVarSet() functions?
Think about it. Tomasz can do anything he wants with the scripting
language so why not build in static variables *into* AFL?
For example, you want a static variable that's local to an AFL
script?
No problem, here's the declaration:
static variablename;
Do you want a static variable that is GLOBAL to *all* AFL scripts?
Again, no problem, this could do it:
global static variablename;
And, of course, it doesn't matter whether the variable is a string,
number or array. It's all TRANSPARENT because it would be built-in
to AFL.
Sure, this is a simplistic approach and just an initial idea. I
know that the next common question is going to be "what if you have
a "static variablename" in one AFL module and a "global static
varaiblename" in another and that creates a problem because the
names of the variables are the same but at different scopes that
overlap one another....etc. etc. (details, details...this can easily
be worked out with more thought) [Well, a more sophisticated
approach would incorporate the idea of namespaces like you have in
C++, etc so you can easily organize the partitioning of your
variables.]
The main point I'm trying to make though is that since AFL is built
into the charting package known as Amibroker then the language
itself should be able to express the nature of a variable's scope
within and between AFL scripts running inside Amibroker and their
respective lifetimes.
Steve