乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 76|回复: 5

[编程交流] dcl - popup list to remember l

[复制链接]

49

主题

177

帖子

130

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
243
发表于 2022-7-5 22:55:43 | 显示全部楼层 |阅读模式
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
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:15:40 | 显示全部楼层
Read about the function set_tile and remove the the function value with its related codes .
回复

使用道具 举报

49

主题

177

帖子

130

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
243
发表于 2022-7-5 23:31:39 | 显示全部楼层
Worked like a charm! Indeed I should have read more about the set_tile before posting. Thanks
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 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 .
回复

使用道具 举报

49

主题

177

帖子

130

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
243
发表于 2022-7-5 23:48:26 | 显示全部楼层
Thanks. I did that. My variables are global.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:55:56 | 显示全部楼层
 
Good stuff
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 03:06 , Processed in 0.484734 second(s), 64 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表