Is the current record the last one?

pedroccdapedroccda Member Posts: 90
Hi, I want to undertstand how I can know when the current record I'm working with is the last one (or if there are no other record after the current)? Is there any function to call to know it or a trigger that is fired automatically at last record (or end of record).
Kiki

Comments

  • SteveOSteveO Member Posts: 164
    If NEXT = 0 then you know that the record you are on is the last one. However, if next <> 0 then it will go on to the next record and thereby change the current record that you are on.

    eg.
    IF FIND('-') THEN
    REPEAT
    something;
    UNTIL NEXT = 0;

    The above is code used to loop through a table and perform some action.
    This isn't a signature, I type this at the bottom of every message
  • kinekine Member Posts: 12,562
      OnAfterGetCurrRecord()
    
      TmpRec.COPY(Rec);
      if TmpRec.NEXT=0 then begin
        some code for last entry...
      end;
    
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.