Post Reply 
(Recursive) nested loops and IFs?
12-17-2015, 11:50 AM
Post: #3
RE: (Recursive) nested loops and IFs?
You can replace the nested IFs with a single IF which will work for any size of L5.

Replace:
Code:

     IF (EXPR(L5(1))>=0 AND EXPR(L5(1))<=9) THEN
      IF (EXPR(L5(2))>=0 AND EXPR(L5(2))<=9) THEN
       IF (EXPR(L5(3))>=0 AND EXPR(L5(3))<=9) THEN
        IF (EXPR(L5(4))>=0 AND EXPR(L5(4))<=9) THEN
         IF (EXPR(L5(5))>=0 AND EXPR(L5(5))<=9) THEN
          IF (EXPR(L5(6))>=0 AND EXPR(L5(6))<=9) THEN
           [...]
          END;
         END;
        END;
       END;
      END; 
     END;

By:
Code:

     IF ΠLIST(EXECON("EXPR(&1)>=0 AND EXPR(&1)<=9",L5)) THEN
       [...]
     END;

Thanks for publishing your program, do you have some data samples that could be used to test it?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (Recursive) nested loops and IFs? - Didier Lachieze - 12-17-2015 11:50 AM



User(s) browsing this thread: 1 Guest(s)