Thanks, Vovka. That was brilliant, and exactly what I needed. It took me a while to understand it.
Thanks also John and PKENEWELL for replies, but I was trying to avoid entering a point by using the @ symbol and the comma, since those are not on the numeric keypad. With Vovka's method, I can prompt for a picked point or a single number. If the user opts to enter a number, it can be done using just the numeric keypad, and then another number can be entered there as the Y-coordinate. If the user opts to pick a point, then that point is used instead of entering coordinates.
I wanted this for input of the second corner of a rectangle, either by pick point or by coordinates. Unfortunately, there's no rubber banding. But with a variation in the value of initget, the user can opt to just press Enter, and then pick the second corner with rubber banding.
(defun Waitcom () (while (> (getvar "cmdactive") 0) (command pause)) ) ; subroutine
(defun c:RR ( / p1 p2 x1 y1 inp1)
(setq p1 (getpoint "First corner of Rectangle: "))
; second input can be either a point (2nd corner) or a number (width)
(initget 129) ; bit 7 allows arbitrary input as if it is a keyword
; if bits 7 and 0 are set and the user presses Enter, a null string is returned.
(if (setq inp2 (getcorner p1 "Second corner or width: ")) (progn
;----if there's any input in response to getpoint, continue
(if (listp inp2)
;----test whether the input is a list, i.e. a point rather than a single number
(progn ;----start of the Then expression
(setq p2 inp2) ; then the input is the second corner
(command "Rectang" p1 p2) ; draw a rectangle between the two corners
) ;----end of the Then expression
(progn ;----start of the first Else expression
(setq x1 (read inp2)) ; else the first list or atom in the input string is the width
(if x1 ;----test whether the entered width was non-nil
(progn ;----start of the second Then expression
(setq y1 (getreal "Height of Rectangle: ")) ;----then get the height...
(command "Rectang" "D" x1 y1 p1) (Waitcom)
;----and draw a rectangle by width/height/point
) ;----end of the second Then expression
(progn ; beginning of the second Else expression:
; if not non-nil, then the input was just Enter
(command "Rectang" p1) (Waitcom) ;----else draw a rectangle from p1
) ;----end of the second Else expression
) ;----end of If the entered width was non-nil
) ;----end of the first Else expression
) ;----end (if) the input is a point
)) ;----end (if) there was any input at all and its progn
(sssetfirst nil (ssget "L"))
) ;----end defun
edited: second (getpoint) changed to (getcorner p1); subroutine added