GetKeyword Method

Gets a keyword string from the user.

See Also | Example


RetVal = GetKeyword([Prompt])


The object or objects this method applies to.


Variant (string); input-only; optional
The text used to prompt the user for input.


The keyword returned from the user.


AutoCAD pauses for user input of a keyword and sets the return value to the keyword that was entered. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The prompt is optional. The maximum length of the return value is 511 characters.

The AutoCAD user can enter the keyword from the keyboard. The list of keywords that this method will accept is set by a prior call to the InitializeUserInput method. If the user enters a string not specified in the call to InitializeUserInput, AutoCAD displays an error message and tries again (and redisplays the prompt, if one was specified). If the user doesn't enter anything but presses the ENTER key, GetKeyword returns an empty string ("") unless the call to InitializeUserInput also disallowed NULL input.