I have been able to go halfway through with the following code with rearrangement of data:
- (defun diqsets() (setq ql '(6.0 9.0 28.0 40.0 55.0 66.0 72.0 110.0 120.0)) (setq dl '((10.97 150.0 120.0) (11.46 150.0 110.0) (12.02 150.0 100.0) (21.09 200.0 150.0) (21.83 200.0 140.0) (23.58 200.0 120.0) (26.34 225.0 180.0) (27.10 225.0 170.0) (27.94 225.0 160.0) (28.85 225.0 150.0) (43.86 300.0 300.0) (45.40 300.0 280.0) (47.11 300.0 260.0) (48.04 300.0 250.0) (51.21 300.0 220.0) (53.71 300.0 200.0) (56.62 300.0 180.0) (73.51 375.0 350.0) (76.88 375.0 320.0) (79.40 375.0 300.0) (82.19 375.0 280.0) (111.69 450.0 400.0) (116.13 450.0 370.0) (119.40 450.0 350.0) (124.87 450.0 320.0) (214.17 600.0 500.0) (226.35 600.0 450.0) (240.08 600.0 400.0)))) (diqsets)(defun test( / i qin q iset) (setq n (length ql) qin (car ql) q (caar dl) i (caddr(car dl))) (if (and(> q qin) (>= n 1)) (test1) ) (if(and(> qin q) (>= n 1)) (test2) ))(defun test1() (if(and(> q qin) (>= n 1)) (progn (while (and(> q qin) (>= n 1)) (setq iset(cons i iset) q (caar dl) i (caddr(car dl)) n (- n 1) ql (cdr ql) qin (car ql)))) (test2)))(defun test2()(if (and(> qin q) (>= n 1)) (progn (while (and (> qin q) (>= n 1)) (setq dl (cdr dl) q (caar dl) qin (car ql) i (caddr(car dl))) ) ) (test1) ))
There is no need for the '(flow d i)' function as the return values of q has already been included in the sublist with the first item in it. When debugged I find that the code works ok up to the thirteenth sublist (that is (28.85 225.0 150.0). The first figure being the value of q and then the diameter and the slope (or gradient) in that order. Then the whole of function 'test' get highlighted and the debugging terminates. Is there any way to force the control to test1 function to finish it off.
Any help would be very much appreciated.
Aloy. |