- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, all.
I would like to learn how to hold a string message on the command line (the main, active line) for a set time like, say, 5 full seconds.
I've used the "delay" command, as well as another set of code but it is not working as expected. Here are the code lines I have used so far.
Using "delay":
(defun C:test1 ()
(princ "\nHold this message")
(command "delay" 5000)
(princ "\nEnd")
(princ)
)
But the command line did the delay first, then the two "princ" lines (out of order then)...
I also found a different way to accomplish the delay without using the "command" function:
(defun C:test2 ()
(princ "\nHold this message")
(wait 5)
(princ "\nEnd")
(princ)
)
(defun wait (seconds / stop)
(setq stop (+ (getvar "DATE") (/ seconds 86400.0)))
(while (> stop (getvar "DATE")))
)
But the result was exactly the same. Here's what appeared on the command line:
Command: TEST2 <<this line was delayed for 5 seconds. Really, just "Command: TEST2" for 5 seconds>>
Hold this message
End
Command:
Do you see what I am doing wrong? I would like to have "Hold this message" delayed in the command line for 5 (or however many) seconds...
Thanks in advance!
Solved! Go to Solution.