getkword and ( )

Jason Piercey

Usenet Archive
Joined
Jun 30, 2003
Messages
868
Reaction score
0
Just noticing this....

(defun c:test
(initget "A B")
(getkword "\n[A(1)/B(2)]testing:")
)

and give a right click and select an option.. :(

So, what other characters make strange things happen?

I really wanted to use the . I am building prompts on the fly and within the set of was just some extra info for the user about that particular keyword.
 
Didn't understand the question at first, but perhaps an alternative method could be applied.

Rudy Tovar said:
(getstring (STRCAT "\nA " (CHR 40) "C" (CHR 41)"at: "))

Jason Piercey said:
Just noticing this....

(defun c:test
(initget "A B")
(getkword "\n[A(1)/B(2)]testing:")
)

and give a right click and select an option.. :(

So, what other characters make strange things happen?

I really wanted to use the . I am building prompts on the fly and within the set of was just some extra info for the user about that particular keyword.
 
I would suggest writing to a file, and loading the temp file each time on the fly.

Rudy Tovar said:
Didn't understand the question at first, but perhaps an alternative method could be applied.

Rudy Tovar said:
(getstring (STRCAT "\nA " (CHR 40) "C" (CHR 41)"at: "))

Jason Piercey said:
Just noticing this....

(defun c:test
(initget "A B")
(getkword "\n[A(1)/B(2)]testing:")
)

and give a right click and select an option.. :(

So, what other characters make strange things happen?

I really wanted to use the . I am building prompts on the fly and within the set of was just some extra info for the user about that particular keyword.
 
Not sure I follow you there.. I may end up not using
(getkword), not because of the right click problem but due to the keywords. They are numbers in this case, and would like to be able to enter a decimal value or a value expressed in the current unit format.
 
Hi Kelie,

That is the problem, using a set of in a keyword or within a set of at the prompt, makes the right click options useless.
 
did you try {} ? or ? or ?

Jason Piercey said:
Hi Kelie,

That is the problem, using a set of in a keyword or within a set of at the prompt, makes the right click options useless.

Kelie said:
Jason,

What's the problem here. Seems it works fine. But you can't use right-click for options here, can you?
 
Yeah, I fiddled with 'em for a while... already serves a purpose within the right click, don't like the way the others read in a prompt so I decided to just (princ) an extra line before the user prompt to get essentially the same effect. (princ)ing the extra line is more than likely what I should have been doing in the first place.
 
Sorry Jason I'm not following you.
Are you saying if you change the code to

(defun c:test
(initget "A B")
(getkword "\n[A1/B2]testing:") ;;; or simply (getkword "\ntesting:")
)

You can right-click to choose "A" or "B"? Where do you right-click? In command line? I can't make it happen.

Jason Piercey said:
Hi Kelie,

That is the problem, using a set of in a keyword or within a set of at the prompt, makes the right click options useless.

Kelie said:
Jason,

What's the problem here. Seems it works fine. But you can't use right-click for options here, can you?
 
(defun c:test
(initget "A B")
(getkword "\n[A/B]testing:")
)

while c:test is running right click in the drawing area and you will have the A and B option listed. The [ / ] format makes that a possibility.

What I noticed was that using a set of in the user prompt and/or in the call to (initget), the right click no longer works. Just something "funny" about those characters and (initget)

this fails.

(defun c:test
(initget "(A) (B)")
(getkword "\n[(A)/(B)]testing:")
)
 
Jason,

Give this a try:

(defun C:Test
(initget "A B")
(getkword "\nTesting tricky prompts [A (one)/B (two)]: "))

The trick is that you don't want to complicate your keywords, only inform the user (via the prompt).

--
R. Robert Bell, MCSE
www.AcadX.com

| (defun c:test
| (initget "A B")
| (getkword "\n[A/B]testing:")
| )
|
| while c:test is running right click in the drawing area | and you will have the A and B option listed. The | [ / ] format makes that a possibility. | | What I noticed was that using a set of in the user prompt | and/or in the call to (initget), the right click no longer works. | Just something "funny" about those characters and (initget) | | this fails. | | (defun c:test | (initget "(A) (B)") | (getkword "\n[(A)/(B)]testing:") | ) | | | -- | | -Jason | Member of the Autodesk Discussion Forum Moderator Program | | | > Sorry Jason I'm not following you. | > Are you saying if you change the code to | > | > (defun c:test | > (initget "A B") | > (getkword "\n[A1/B2]testing:") ;;; or simply (getkword "\ntesting:") | > ) | > | > You can right-click to choose "A" or "B"? Where do you right-click? In | > command line? I can't make it | > happen. | |
 
don't think it has anything to do with spaces...

this works (without spaces)
(defun C:Test
(initget "A B")
(getkword "\nTesting tricky prompts [A(one)/B(two)]: "))

this does not (without spaces)
(defun C:Test
(initget "A B")
(getkword "\nTesting tricky prompts [A(One)/B(Two)]: "))

nor does this (without spaces)
(defun C:Test
(initget "A B")
(getkword "\nTesting tricky prompts [A(1)/B(2)]: "))

nor does this (with spaces)
(defun C:Test
(initget "A B")
(getkword "\nTesting tricky prompts [A (One)/B (Two)]: "))

guess I wasn't realizing that the number inside (or capital letter) was the culprit, not the set of .

I have since gone to another print statement anyhow, it works out for the better in more than one way for me. Don't know what I was thinking (not an uncommon thing :)
 
Thanks Jason. I've been using getkword for a while. Never knew I have the right-click option here.

Jason Piercey said:
(defun c:test
(initget "A B")
(getkword "\n[A/B]testing:")
)

while c:test is running right click in the drawing area and you will have the A and B option listed. The [ / ] format makes that a possibility.

What I noticed was that using a set of in the user prompt and/or in the call to (initget), the right click no longer works. Just something "funny" about those characters and (initget)

this fails.

(defun c:test
(initget "(A) (B)")
(getkword "\n[(A)/(B)]testing:")
)

Sorry Jason I'm not following you.
Are you saying if you change the code to

(defun c:test
(initget "A B")
(getkword "\n[A1/B2]testing:") ;;; or simply (getkword "\ntesting:")
)

You can right-click to choose "A" or "B"? Where do you right-click? In command line? I can't make it happen.
 
You have to use the brackets though instead of the old brackets generally used to specify the options to get the right-click options in there though.
 
Back
Top