View Full Version : basic reactor question?
sturner
2009-07-30, 03:01 PM
i've been working my way thru reactors mostly dealing with work from previous cad managers:?
anyway as i have been looking thru the examples here and elsewhere a few question have popped up. in particular code like this ((wcmatch cmd "*image*") what do the ** represent are they a wildcard character? also what purpose the colon serve? as in '((:vlr-command...
thanks in advance for helping a newb!
ccowgill
2009-07-30, 05:26 PM
i've been working my way thru reactors mostly dealing with work from previous cad managers:?
anyway as i have been looking thru the examples here and elsewhere a few question have popped up. in particular code like this ((wcmatch cmd "*image*") what do the ** represent are they a wildcard character? also what purpose the colon serve? as in '((:vlr-command...
thanks in advance for helping a newb!
* is a wild card character, it tells wcmatch to find the word image in the string cmd, no matter what is on either side of it. I will have to defer the : question, as I know it is required but have never really asked why.
msretenovic
2009-07-31, 03:44 PM
The colon is part of the keyword - similar to :vlax-True and :vlax-False. It appears to be no more than a way to identify the constants that Autodesk used in VLISP quickly. :)
Remember, in LISP, a colon can be used in a variable or function name just as any other alphanumeric character. :wink:
RobertB
2009-07-31, 09:14 PM
... ((wcmatch cmd "*image*") what do the [COLOR=red]** represent are they a wildcard character? The documentation on wcmatch completely describes how to use wildcards.
peter
2009-08-02, 11:36 PM
Just for an very simple example of a reactor
(defun sysvarCallBack (rxnCall lstCallback)
(print rxnCall)
(print lstCallBack)
)
(setq rxnSysVar (vlr-sysvar-reactor nil '((:vlr-sysvarwillchange . sysvarCallback))))
rkmcswain
2009-08-03, 01:52 AM
Just for an very simple example of a reactor
(defun sysvarCallBack (rxnCall lstCallback)
(print rxnCall)
(print lstCallBack)
)
(setq rxnSysVar (vlr-sysvar-reactor nil '((:vlr-sysvarwillchange . sysvarCallback))))
Every time I see a good example of VL reactor code, it's almost always from you... ;)
I created an entire post based on some code you had posted once, giving you credit of course. Hope you're OK with that..
http://cadpanacea.com/node/53
Thanks.
sturner
2009-08-06, 02:42 PM
Awesome thanks everyone!:beer:
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.