How to fill listview from foreach loop

Started by jrupert, February 04, 2014, 08:33:26 AM

Previous topic - Next topic

jrupert

I have the following code;

(if (> LGTH 1)
    (progn
        (setq cntr 0)
   (foreach N L1
       (setq gbspn (rtos (car N) 2 0 ))
       (setq custpn (cadr N))
       (setq path (caddr N))
       (dcl_ListView_FillList GBSCC_FormGBSCC_ListView1
           (list
               (list gbspn cntr custpn cntr path cntr)
           )
       )
                               
       (setq cntr (+ cntr 1))
            )

        )
)

This works, but, only fills the listview with the last element of the list L1.
It seems as if the listview items are reset on each iteration.

Any suggestions on HOW to make this work?

owenwengerd


jrupert

Thank You very much sir!

I have been writing code since 1983 (not in AutoLisp obviously)...maybe someday I will learn this languge also!

owenwengerd

You're very welcome! I have no doubt that you will learn this one as well. :)