Jump to content

How can I assign a VLR action to list Command ?


ketxu

Recommended Posts

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...