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

Re: [amibroker] Improvement of AFL on-line function reference and AFL library



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Hello,
> 
> I received the following two questions by support channel
> and thought that reply may interest more people:
> 
> Q1.   What is the difference between    StaticSetVar("x",5); and  
x=5;
> 
Tomasz,
I suppose you mean StaticVarSet("x",5).
Dimitris Tsokakis
> A1: Read me says:
> ** Static variable - the variable has static duration (it is 
allocated when the program begins and deallocated when the program
> ends)
> and initializes it to Null unless another value is specified. 
Static variables allow to share values between various formulas.
> Only NUMBER and STRING static variables are supported now (not 
ARRAYS).
> 
> So, speaking about the difference
> x=5; is regular variable that "lives" only DURING execution of the 
formula.
> 
> StaticSetVar("x",5);
> - gives you an access to static data storage that REMAINS between 
execution of formulas (as long AmiBroker is running)
> and is accessible from ANY formula.
> You can call StaticGetVar("x") from a DIFFERENT formula and you 
will get the value set  from another formula.
> 
> So Static variables are BOTH persistent (as long as AmiBroker is 
running) and global (in "wider" scope - between different formulas)
> 
> Static variables can be used instead of external files to store 
values between formula invocations.
> 
> 
> -----------
> Q2. Can I access vars that are defined in a DLL by using 
StaticVarGet?
> 
> A2: Only if you create them using StaticVarSet.
> (You can call StaticVarSet from DLL using gSite.CallFunction)
> 
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/