generally, Repeat statement is used as looping statement in record type of variable.
syntax :
REPEAT
UNTILL Record.next(step)=0.
eg.
Repeat
message(CustRec. Name);
untill CustRec.next=0;
in above example, it will display customer name for all records available in CustRec Record type variable. when record reach at last record after that CustRec.next statement return 0. thus loop is completed.
if you want to read more about it then refer. online help avalible in Navision.
Doesn't have to be a record, it is a looping mechanism plain and simple. It repeats a number of statements until a condition is met. One of my former coworkers created an endless loop:
REPEAT
UNTIL HellFreezesOver;
HellFreezesOver is a boolean variable that never gets set
When looping a set of records it's more like this:
IF Rec.FINDSET THEN BEGIN
// do what you need to do before the looping starts
REPEAT
// do what needs to be repeated
UNTIL Rec.NEXT = 0;
// clean up after the loop
END;
Comments
syntax :
REPEAT
UNTILL Record.next(step)=0.
eg.
Repeat
message(CustRec. Name);
untill CustRec.next=0;
in above example, it will display customer name for all records available in CustRec Record type variable. when record reach at last record after that CustRec.next statement return 0. thus loop is completed.
if you want to read more about it then refer. online help avalible in Navision.
Rajesh Patel
RIS Plus, LLC
Rajesh Patel
Dynamics NAV Enthusiast
RIS Plus, LLC