(vl-catch-all-apply 'command (list pause))

(vl-catch-all-apply 'command (list pause))

mdhutchinson
Advisor Advisor
1,215 Views
3 Replies
Message 1 of 4

(vl-catch-all-apply 'command (list pause))

mdhutchinson
Advisor
Advisor

I have the following loop to run until the user is finished with the command. An <Enter> key works as I want.

 

 

(while (= (getvar "cmdactive") 1)	
   (command pause)
)
... continue with more code

... however, quite often the user hit <esc> key instead.

Can't I trap for this - with something like the following?

 

(while (= (getvar "cmdactive") 1)	
   (vl-catch-all-error-p (vl-catch-all-apply 'command (list pause)))
)
... continue with more code

 

Your thoughts?

0 Likes
Accepted solutions (1)
1,216 Views
3 Replies
Replies (3)
Message 2 of 4

hmsilva
Mentor
Mentor
Accepted solution

Try

 

(vl-catch-all-error-p (vl-catch-all-apply 'vl-cmdf (list pause)))

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 4

mdhutchinson
Advisor
Advisor

Yep... that works.

 

(vl-catch-all-error-p (vl-catch-all-apply 'vl-cmdf (list pause)))

so does this... 

 

(vl-catch-all-error-p (vl-catch-all-apply (function (lambda (x)(command pause))) (list nill)))

Your's is better.

 

Thanks.

0 Likes
Message 4 of 4

hmsilva
Mentor
Mentor

@mdhutchinson wrote:

Yep... that works.

 

(vl-catch-all-error-p (vl-catch-all-apply 'vl-cmdf (list pause)))

so does this... 

 

(vl-catch-all-error-p (vl-catch-all-apply (function (lambda (x)(command pause))) (list nill)))

Your's is better.

 

Thanks.


You're welcome, mdhutchinson
Glad I could help

Henrique

EESignature

0 Likes