FLASH Question: is there another record after this?

BeliasBelias Member Posts: 2,998
is there a NAV built-in function which determine if there are further records after the current one?

(I don't want to step using NEXT, or use FINDLAST and compare the two records)

I don't know what to search in the help
A Quick answer is appreciated...holyday is incoming! :mrgreen::mrgreen:
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Answers

  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    FIND('>')

    Take care of the current key and all filters set.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • BeliasBelias Member Posts: 2,998
    yes, but it changes the reference to the record...my problem is that I don't want to change the reference the current record...it's hard to explain why I have to do this, but this is my problem... :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Then just take another record variable of the same type, fill in the key fields of the current key (or for all I care copy the complete record) and use FIND('>') with your second record variable.
    Maybe I don't understand the problem?! :?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    You can also set a filter based on your current key and then use ISEMPTY. After that you can solve the filter and your record variable shouldn't refer to another record.
    I mean something like that
    Cust.GET('100011');
    Cust.SETFILTER("No.",'>%1',Cust."No.");
    IF Cust.ISEMPTY THEN BEGIN
      Cust.SETRANGE("No.");
      ...
    END ELSE BEGIN
      Cust.SETRANGE("No.");
      ...
    END;
    
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • BeliasBelias Member Posts: 2,998
    I was on holiday... :mrgreen: ...thanks...you understand the problem, but i will use a boolean...i hoped there was a particular function, but if I have to do all this...maybe it's faster and clearer to use boolean
    byee!
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • krikikriki Member, Moderator Posts: 9,110
    You can also try this:

    This code has the performance-advantage that you do ONLY one extra read on the DB.
    recTheTable.RESET;
    recTheTable.SETCURRENTKEY(...);
    recTheTable.SETRANGE / SETFILTER(...);
    IF recTheTable.FINDLAST THEN
      recTheTableLAST := recTheTable;
    
    FINDSET;
    REPEAT
      IF (recTheTable."Primary Key Field 1" = recTheTableLAST."Primary Key Field 1") AND
          (recTheTable."Primary Key Field 2" = recTheTableLAST."Primary Key Field 2") AND
         .... THEN
        MESSAGE('Current Record is the last record in the filter');
    
      ... other commands
    
    UNTIL recTheTable.NEXT = 0;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.