Bruce, I'm happy to use IsNull() and "move on" <g>. Thanks for reminding me of that one.
Very nice article! Thanks kindly for wrapping it up yesterday and posting the link in response to my question. (The parts about GetChartID() and SetBarsRequired() were as timely as the rest!) Cheers! --- In [email protected], "Bruce" <bru...@...> wrote: > > 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" <progster@> 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 > > >
