[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Static variables - why can't it be this simple?



PureBytes Links

Trading Reference Links

I think you hit the nail on the head …

 

Tomasz can do anything he wants

 

Then again there’s the other alternative i.e. … If it am not broken, don’t fix it ...  

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of scourt2000
Sent: Sunday, August 19, 2007 1:17 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Static variables - why can't it be this simple?

 


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



I am using the free version of SPAMfighter for private users.
It has removed 28 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___