Gets an integer value
from the user.
Signature
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.
Remarks
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 ()
(vl-load-com)
(setq util (vla-get-utility
(vla-get-activedocument
(vlax-get-acad-object))))
(setq theinteger (vla-GetInteger util "\nEnter Integer : "))
(princ theinteger)
(princ)
);defun
|
|