GetInteger Method

Back to Methods Reference

Gets an integer value from the user.


VBA : RetVal = object.GetInteger([Prompt])

VL : RetVal = (vla-GetInteger object Prompt)

(vla-GetInteger util "\nEnter Integer : ")

  • Object : Utility
    The object or objects this method applies to.

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

  • RetVal : Integer
    The integer value returned by the user.


AutoCAD pauses for user input of an integer and sets the return value to the selected value. The Prompt parameter specifies a string that AutoCAD displays before it pauses. The Prompt is optional.

The AutoCAD user can enter any valid (short) integer in the range of -32,768 to +32,767.

If a keyword is returned instead of an integer, or if the user presses ENTER without entering a value, AutoCAD generates error number -2145320928 (and the error message, "User input is a keyword"). Use the GetInput method to obtain the keyword from the return value.

Example :

(defun c:al-getinteger ()


(setq util (vla-get-utility 
(setq theinteger (vla-GetInteger util "\nEnter Integer : "))

(princ theinteger)



The AutoLisp/Visual Lisp/VBA Resource Website
Search the WWW Search AfraLisp

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website