I wrote a function below to update a table. The data I’m trying to modify is a part of a key as shown in SETCURRENTKEY. I was expecting the function to start looping from the first record and modify each record’s line no by adding 100. However, the loop is not working. Am I missing something? Please look at it and suggest any possible fix.
XYZ.SETCURRENTKEY(“Job No.”, “Line No.”, “Report Name”);
XYZ.SETFILTER(“Job No.”, ‘ABC’);
IF XYZ.FINDSET(TRUE, TRUE) THEN BEGIN
REPEAT
XYZ.”Line No.” := XYZ.”Line No.” + 100;
XYZ.MODIFY;
UNTIL XYZ.NEXT <= 0;
END;
Where, XYZ is the table name; ABC is the Job no in XYZ table; Line No is a field in XYZ table, which is also part of a key.