Options

Help!!!!

PanteraPantera Member Posts: 10
Hello!!

I want to put this question:

Instead of doing this:

find('-')
repeat

until next =0

I want to start at the end until the first
find('+')
repeat

until ..........

The "PREVIOUS" don´t exist,so what i do?????Help me!!!

Thanks!!!

Comments

  • Options
    elToritoelTorito Member Posts: 191
    Example
    This example shows how to use the NEXT function:

    Count := 0;
    IF Customer.FIND('-') THEN
    REPEAT
    Count := Count + 1;
    UNTIL Customer.NEXT = 0;

    This code uses a REPEAT UNTIL loop to count the number of entries in the Customer table. The FIND function finds the first entry in the table. Each time the system calls NEXT, it steps one record forward. When NEXT equals zero (0), there are no more entries in the table and the system exits the loop.
    (Oo)=*=(oO)
  • Options
    xrivoxrivo Member Posts: 56
    find('+');
    repeat
    //code

    until next(-1)=0;
  • Options
    PanteraPantera Member Posts: 10
    xrivo wrote:
    find('+');
    repeat
    //code

    until next(-1)=0;

    Thanks :wink:
  • Options
    eromeineromein Member Posts: 589
    If you want to change a field which you are filtering on you could this as well:

    Record.SETRANGE(foo, 'bar');
    WHILE Record.FIND('+') DO BEGIN
    Record.foo := 'foo';
    Record.MODIFY;
    END;
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
  • Options
    jreynoldsjreynolds Member Posts: 175
    Just to throw another option into the mix, you could use ASCENDING to change the order of the search.
  • Options
    eromeineromein Member Posts: 589
    Standard Navision would user a NEXT(-1)

    That would be the only correct way to go...
    "Real programmers don't comment their code.
    If it was hard to write, it should be hard to understand."
Sign In or Register to comment.