Author Topic: Question about "initget"  (Read 5314 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Question about "initget"
« Reply #15 on: April 22, 2013, 11:07:13 PM »
In ACAD2006
Code: [Select]
Command: (initget 1 "D E F")
nil

Command: (getkword "\nChoose a Letter [D/E/F]: ")

Choose a Letter [D/E/F]: e
"E"

Command: (getkword "\nChoose a Letter [D/E/F]: ")

Choose a Letter [D/E/F]: a

Invalid option keyword.

Choose a Letter [D/E/F]: f
"F"
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MeasureUp

  • Bull Frog
  • Posts: 462
Re: Question about "initget"
« Reply #16 on: April 22, 2013, 11:24:06 PM »
In ACAD2006
Code: [Select]
Command: (initget 1 "D E F")
nil

Command: (getkword "\nChoose a Letter [D/E/F]: ")

Choose a Letter [D/E/F]: e
"E"

Command: (getkword "\nChoose a Letter [D/E/F]: ")

Choose a Letter [D/E/F]: a

Invalid option keyword.

Choose a Letter [D/E/F]: f
"F"

Thanks CAB, have you tried (initget 1 "A B C") first, then (initget 1 "D E F") and (getkeyword "D/E/F: ")?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Question about "initget"
« Reply #17 on: April 22, 2013, 11:37:24 PM »
Oh it ignores the second initget.  :o
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Question about "initget"
« Reply #18 on: April 22, 2013, 11:39:31 PM »
In VLIDE it behaves normally.  8)

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MeasureUp

  • Bull Frog
  • Posts: 462
Re: Question about "initget"
« Reply #19 on: April 23, 2013, 12:04:43 AM »
In VLIDE it behaves normally.  8)

I can't find any errors by using VLIDE.
And that is why I don't mention of using it.
From the command prompt, the 1st set of "initget" looks fine:
Code: [Select]
(initget "A B C")
(setq ABC (getkword "\nSelect A/B/C: "))
Select A/B/C: -> A
"A"

but the 2nd set has a problem:
Code: [Select]
(initget "D E F")
(setq DEF (getkword "\nSelect D/E/F: "))
Select D/E/F: -> D
Invalid option keyword.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Question about "initget"
« Reply #20 on: April 23, 2013, 01:50:50 AM »
What happens if you put the code into a function body and load the file containing it and run the function.

Not many of us would expect to enter the code line by line at the command line ...
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.