Those are all really complicated ways, here is how I handle it:
(setq ob nil);Set the variable to nil for use later
(setq ob (entsel "\nPlease select text: "));Ask for input
(while (= ob nil);If input is not provided, keep asking until it is provided or the command is canceled.
(setq ob (entsel "\nYou need to select text or cancel the command.\nPlease select text: ")); Asks for input
); End of loop
If I need a point:
(setq pt nil)
(setq pt (entsel "\nPlease select text: "))
(while (= pt nil)
(setq pt (getpoint "\nYou need to select text or cancel the command.\nPlease select text: "))
)
If I need to get an object based on the point:
(setq pt nil)
(setq ob nil)
(setq pt (entsel "\nPlease select text: "))
(while (= ob nil)
(progn
(while (= pt nil)
(setq pt (getpoint "\nYou need to select text or cancel the command.\nPlease select text: "))
)
(setq ob (nentselp "" pt));This allows you to select something without the user actually picking on it.
(if (= ob nil);If there is no object, require the user to keep picking until the get something.
(setq pt nil)
)
)
)
Hopefully that is enough to get you started.