getint

AutoCad AutoLISP Functions

 
getint
 
 
 

Pauses for user input of an integer, and returns that integer

(getint [msg]) 

Values passed to getint can range from -32,768 to +32,767. If the user enters something other than an integer, getint displays the message, “Requires an integer value,” and allows the user to try again. The user cannot enter another AutoLISP expression as the response to a getint request.

Arguments

msg

A string to be displayed to prompt the user; if omitted, no message is displayed.

Return Values

The integer specified by the user; otherwise nil, if the user presses ENTER without entering an integer.

Examples

Command: (setq num (getint))

15

15

Command: (setq num (getint "Enter a number:"))

Enter a number: 25

25

Command: (setq num (getint))

15.0

Requires an integer value.

15

15

See Also