MJLM 发表于 2022-7-5 22:55:43

dcl - popup list to remember l

I have made a popup list using dcl and autolisp and this popup list is geting its values from a list. The popup list is assigned to a variable to use elsewhere. Every time I run the routine the window shows the popup list with a default value. That makes sense since in the dcl file there is a statement
 
      label = "&xxx";            
   : popup_list {                  
         key = "pipemat";               
         value = "0" ;                  
         }
 
However I want to make it so that each time I run the routine, the popup list displays the value selected from the list last time it run, not the default defined as above in the dcl file.
 
I seems dcl is not working like autolisp. I tried the following but it is not working
 
value = (itoa (1+ (vl-position somevar somelist))))
 
Is there a way to do it? If so, how could that be done?
Thank you

Tharwat 发表于 2022-7-5 23:15:40

Read about the function set_tile and remove the the function value with its related codes .

MJLM 发表于 2022-7-5 23:31:39

Worked like a charm! Indeed I should have read more about the set_tile before posting. Thanks

Tharwat 发表于 2022-7-5 23:39:49

You're welcome .
 
Furthermore , you need to make the variable that holds the get_tile function's value global to be able to reset the popup_list attribute according to last selection one .

MJLM 发表于 2022-7-5 23:48:26

Thanks. I did that. My variables are global.

Tharwat 发表于 2022-7-5 23:55:56

 
Good stuff
页: [1]
查看完整版本: dcl - popup list to remember l