Re: New version of AIX
Posted in 1994
In article <775918082snz@mags.demon.co.uk>, mags@mags.demon.co.uk (Andrew McGregor) wrote: > We are trying to implement a routine that needs to be able to move to > a specific line in an input array. It's fine moving down (see the FAQ > part 2.4) but we would also like to be able to jump up to a certain row > as well. Any help would be appreciated. FAQ extract follows: Whenever you want to skip to the next line use: NEXT FIELD noentry_field. You can easily extend this feature to allow you to skip to a particular line if you stick your INPUT ARRAY inside a WHILE loop. So.... LET l_finished = FALSE LET l_match_line = 0 # We're not jumping to a line WHILE NOT l_finished INPUT ARRAY la_stuff BEFORE ROW LET l_curr = arr_curr() IF l_match_line THEN # If jumping to a specific line IF l_curr = l_match_line THEN # check if current line is it LET l_match_line = 0 # Yes? - then check no more ELSE NEXT FIELD noentry_field # No? - Skip to next line END IF END IF [ code deleted ] AFTER INPUT FOR l_curr = 1 TO number_of_lines # Check all the lines IF NOT valid_line(l_curr) THEN # in the array are valid LET l_match_line = l_curr # No? - Remember which line EXIT INPUT # was wrong END IF END FOR LET l_finished = TRUE # Everything valid, so can END INPUT # leave input loop END WHILE The above is just a kinda pseudo-code, but you should get the idea. I guess I'll add the expanded explanation to the next FAQ release. ------------------------------------------------ Kerry Sainsbury, kerry@kcbbs.gen.nz R&D Dude, Quanta Systems, Auckland, New Zealand ph. +64 9 377-4473 (work). +64 9 276-5546 (home) -------------------------------------------------