Making default value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm writing a LISP which contains a variable Landing. I made a list of options to choose using Initget function.
Then i used Getkword function with those values. Like that:
(initget 1 "0.26 0.27 0.28 0.29 0.30")
(setq Landing "0.26")
(setq Landing (getkword (strcat "\nEnter the landing distance (m): [0.26/0.27/0.28/0.29/0.30] <" Landing "> :")))
The trouble is when i hit enter button without choosing any value, here it should take the default value as it's defined 0.26 but it never happened.
it works only when i go up and down in the list of options and choose it.
Can you help me how can i make a value as default activated when i press enter without going up and down?
I tried to use cond and if like that :
(if (not Landing) (setq Landing "0.26")
(initget 1 "0.26 0.27 0.28 0.29 0.30")
(setq Landing
(cond
(
(getkword (strcat "\nEnter the landing distance (m): [0.26/0.27/0.28/0.29/0.30] <" Landing "> :"))
(Landing)
)
)
But it goes wrong.
Thanks for all 🙂