I did a loop and i would like to have the previous record of that loop (not the last record). How can i get the previous record ? My loop type is REPEAT...UNTIL. Is it possible to give me an example ?
Thanks in advance !
Sorry my english isn't very good!
Jerome
0
Comments
RIS Plus, LLC
IF myRec.FIND('+')THEN // Find Last
REPEAT
{
Do something
}
UNTIL MyRec.NEXT(-1) = 0; // Move to Previous Record
The -1 is a step and you could use this to step through a record set
This can be a positive to step forwards or a negative to step backwards.
MyStep := -2; // Every Second Record
IF myRec.FIND('+')THEN // Find Last
REPEAT
{
Do something
}
UNTIL MyRec.NEXT(MyStep) = 0; // Move to Second Previous Record
Next Button Code
IF NEXT <> 0 THEN // Test for EOF
NEXT; // Move to Next Record
Previous Button Code
IF NEXT(-1) <> 0 THEN // Test for BOF
NEXT(-1); // Move to Previous Record
:whistle:
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
IF NEXT(1) = 0 THEN;
or:
IF NEXT(-1) = 0 THEN;
RIS Plus, LLC
Yes you are right I was in the wrong language mindset, testing for BOF or EOF before moving the record pointer, I was away with the old VB code!
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
RIS Plus, LLC