Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop was evaluated more times than allowed

Status
Not open for further replies.

bobhagan

MIS
Apr 28, 2001
111
US
WhilePrintingRecords;
DateVar LastReferDt;
DateVar Last3603Dt;
DateVar Next3603Dt;

// hardcoded for test
Last3603Dt := DATE(2005,4,1);
LastReferDt := DATE(2001,1,1);
Next3603Dt := DATE(1999,1,1);

IF Last3603Dt > DATE(0,0,0)
THEN

While Next3603Dt < Last3603Dt Do
(
Next3603Dt := Date(DateAdd("M", 6, LastReferDt))
)

As far as I can see, the While Do loops 13 times. What's wrong with this?

Bob Hagan
 
duh

I needed to increment the Referdt, otherwise it was an endless loop

While Next3603Dt < Last3603Dt Do
(
LastReferDt := Date(DateAdd("M", 6, LastReferDt));
Next3603Dt := LastREferDt;
)
// add this, or evals to t/f
Next3603Dt;

Bob Hagan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top