Progster -
I've seen this before, and it is best left to TJ to explain why. I've
just used the IsNull() function and moved on.
if ( IsNull( StaticVarGet( "passcount" ) ) )
StaticVarSet( "passcount", 1 );
BTW, I went ahead and finished the article off. I know you get the
idea, but it may be of help to others who run into similar problems.
Sorry for the long URL - gotta fix that soon -
<Progster%20-%20%20I%27ve%20seen%20this%20before,%20and%20it%20is%20best\
%20left%20to%20TJ%20to%20explain%20why.%20%20I%27ve%20just%20used%20the%\
20IsNull%28%29%20function%20and%20moved%20on.%20%20if%20%28%20IsNull%28%\
20StaticVarGet%28%20>
http://www.amibrokeru.com/FreeLibrary/FreeArticles/tabid/63/articleType/\
ArticleView/articleId/115/Indicator-Cache-ndash-Dealing-with-Lengthy-Ind\
icator-Re-Calculations.aspx
-- Bruce
--- In [email protected], "progster01" <progs...@...> wrote:
>
>
>
>
> Jules and Bruce,
>
> Thank you both for your comments and suggestions. I'm sure I'll be
able to achieve improvement by working in the indicated directions.
>
> I'll definitely look forward to your article, Bruce, whenever it is
ready.
>
> Thinking of what's been said, I'd like to detect the first pass thru
the code (vs. subsequent passes).
>
> This compiles, but doesn't work:
>
> if( StaticVarGet("PassCount") == Null ){ StaticVarSet( "PassCount", 1
); }
> else StaticVarSet( "PassCount", StaticVarGet("PassCount") + 1 ) ;
> _TRACE( "PassCount: " + NumToStr( StaticVarGet("PassCount"), 1.0) ) ;
>
> ( _TRACE() reports: PassCount: {EMPTY} on every pass. )
>
> I feel sure there must be some simple idiom for doing this. (Perhaps
I'm having a block-head day!) Suggestions?
>
> - Progster
>