ketxu Posted August 22, 2011 Share Posted August 22, 2011 Hi all , please help me this problem. I want to assign a VLR to a list of command name. This list is change by users. as i know, with unknown command, i've to use vlr-unknownCommand, and with other i've use vlr-commandWillStart , vlr-commandEnded.. The big problem is here : i can't know which is known, which is unknown command So, please help me how can i do this thing ? Thank all very much Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 22, 2011 Share Posted August 22, 2011 When the callback function for the command reactor is evaluated, the second parameter is a list containing a string describing the command that caused the reactor to fire. Check this command against your list of commands. Quote Link to comment Share on other sites More sharing options...
ketxu Posted August 22, 2011 Author Share Posted August 22, 2011 hi Lee. My problem is how to decided which vlr-command to use with all command user listed. Example : with a list of all known command like "like,circle,save" : i will use vlr-commandWillStart or vlr-commandended type : (defun VLR-function (objReactor lstOfCommand) (if (wcmatch (car lstOfCommand) "like,circle,save") ;Do sth ... (setq Reactor-Put (vlr-command-reactor nil '((:vlr-commandWillStart . VLR-function)))) With list of unknown command ex "abc,def,lmn..." i will try : (defun VLR-function (objReactor lstOfCommand) (if (wcmatch (car lstOfCommand) "abc,def,lmn..") ;Do sth ... (setq Reactor-Put (vlr-command-reactor nil '((:vlr-unknownCommand . VLR-function)))) But then, if user give me a list "line,circle,abc,def,rectang,ghkj ..." => what can i do ? I can't find way how to know a command is "unknown" or "known" command, and how to combine all in one function vlr Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 22, 2011 Share Posted August 22, 2011 But then, if user give me a list "line,circle,abc,def,rectang,ghkj ..." => what can i do ? Use that list in the same places as your previous example. If the unknown command callback is evaluated, only those commands in the list that are unknown will be wcmatch'ed and vice versa for the known commands with the command reactor. Otherwise the getcname function might be worth looking into. Quote Link to comment Share on other sites More sharing options...
ketxu Posted August 22, 2011 Author Share Posted August 22, 2011 Oh i see. So i will make two reactor with the same list command. All known command will evaluated in the first reactor, and all unknown remain will be resolve in the second reactor ^^ Thank you very very much Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 22, 2011 Share Posted August 22, 2011 Oh i see. So i will make two reactor with the same list command. All known command will evaluated in the first reactor, and all unknown remain will be resolve in the second reactor ^^ Thank you very very much If I have understood your intentions, that was my logic, yes Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 22, 2011 Share Posted August 22, 2011 If I have understood your intentions, that was my logic, yes I'll back that up. I use the unknown-command reactor on a daily basis. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.