乐筑天下

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

[编程交流] Display last input data - like

[复制链接]

52

主题

156

帖子

104

银币

后起之秀

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

铜币
260
发表于 2022-7-5 22:23:45 | 显示全部楼层 |阅读模式
Hi, I am trying to write a program in LISP where the user inputs some data (for instance a window frame thickness), then the next time the command is invoked, the last input for the window thickness is shown, so that when the user presses enter the last input is automatically applied.
What I want is exactly how the Offset command works. It remembers your last input.
How do I write this code to remember the last input?
 
I have got the following code below to work with the first argument (TopOffset), but the second argument (BottomOffset) makes the program not work
 

[code](if (= TopOffsetV null)(setq TopOffsetV "35"))  (setq    TopOffset    (getstring    (strcat "\nEnter Top Caulk Offset
回复

使用道具 举报

52

主题

156

帖子

104

银币

后起之秀

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

铜币
260
发表于 2022-7-5 22:53:09 | 显示全部楼层
I worked out the problem. I simply changed
  1. [color=royalblue]null[/color]
to
  1. [color=royalblue]nil[/color]
and that worked. So simple.
回复

使用道具 举报

1

主题

475

帖子

481

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 22:59:32 | 显示全部楼层
To test null, try
  1. (if (null TopOffsetV)(setq TopOffsetV "35"))
 
Henrique
回复

使用道具 举报

52

主题

156

帖子

104

银币

后起之秀

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

铜币
260
发表于 2022-7-5 23:23:09 | 显示全部楼层
I originally had the code that way around but it just didn't work at all when the code was as you have written. I don't know why, thats why I tried the
  1. (= TopOffsetV null)
 
That worked for the first argument, but not for any after it. So I tried nil and it worked. I had 4 arguments in a row with the same IF arguments
回复

使用道具 举报

1

主题

475

帖子

481

银币

初来乍到

Rank: 1

铜币
5
发表于 2022-7-5 23:38:10 | 显示全部楼层
Andrew,
the
  1. (= TopOffsetV null)
Will return always nil
The
  1. (null TopOffsetV)
will return T if null otherwise nil
 
Henrique
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-11 06:06 , Processed in 0.788741 second(s), 62 queries .

© 2020-2025 乐筑天下

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