Loop through list { if TODAY-item.LastRunDate < 30 { continue; } // code that adds lastrundate to item }
REPEAT continue := false; IF (date <> 0D) THEN IF TODAY - date < 5 THEN continue := true; IF NOT continue THEN BEGIN // code i wanted to run if the date was older than 5 days END;
Answers
What exactly do you want to achieve? Loop through the Item table and do what? And stop when?
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
A condition should do the same:
xStepa
Like the key word continue does in most of the languages. But apparently this language does not have it.
So what I ended up doing was adding a global variable and used that.
1) REPEAT alway goes with UNTIL 2) UNTIL takes a boolean variable or expression, and stops the loop when the variable or expression evaluates to TRUE;
3) you can use filters to limit the number of records you're looping through, instead of looping through all and running a code doing some manipulation in few cases.
Instead of having the following code inside the loop you can build an equivalent loop with a filter. Assuming that you are looping through a record variable called Item, and the record has date field::
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03