try the code below, seems to work fine:

if ( ParamTrigger( "Delete StaticVar", "DELETE" ) )
    StaticVarRemove( "LastBar" );

CurrentBarNo = LastValue( TimeNum() );
//Lastbarvalues=StaticVarGet("LastBar");
if ( IsNull( StaticVarGet( "LastBar" ) ) )
{
    StaticVarSet( "LastBar", CurrentBarNo  );
    _TRACE( "setting static array" + NumToStr( CurrentBarNo ) );
}

herman

> i had this code which would run only once during the first run of
> the afl. now its seems to be running every time. i upgraded to 5.3 recently.

>  CurrentBarNo=LastValue(TimeNum());

> //Lastbarvalues=StaticVarGet("LastBar");
> if(IsNull(StaticVarGet("LastBar"))){
> StaticVarSet("LastBar", CurrentBarNo  );

> _TRACE("setting static array" + NumToStr(CurrentBarNo));
> }

> i was using a version that did not support static arrays before and
> so i may be missing something that i should be doing when checking
> for existance of a static variable. can someone point out what mistake i am 
> making.



> ------------------------------------

> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.

> TO GET TECHNICAL SUPPORT send an e-mail directly to 
> SUPPORT {at} amibroker.com

> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)

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

> Yahoo! Groups Links




Reply via email to