ketxu Posted July 28, 2011 Share Posted July 28, 2011 I've written some function, put it in one lisp file. My idea is in end of file, i'll write a function to check key registered , if unregistered, i assign all function above to a function alert to user that they must register program Ex 1; (defun a ()...) (defun b ()...) .... (defun arlet-unreg ()...) ;EOF (if unregistered (foreach func (list a b) (setq func arlet-unreg) ) ) But it didn't work 2; I must change as bellow to do my idea : (if unregistered (progn (setq a arlet-unreg) (setq b arlet-unreg) ..... ) ) ) and it make my code longer Please tell me what wrong with foreach in code 1st. Thanks all very much Quote Link to comment Share on other sites More sharing options...
ketxu Posted July 28, 2011 Author Share Posted July 28, 2011 Please don't mind. I've solded this problem with set and mapcar lambda. Thanks for reading ^^ Quote Link to comment Share on other sites More sharing options...
BlackBox Posted July 28, 2011 Share Posted July 28, 2011 I've solded this problem with set and mapcar lambda. Could you please post code? Thanks. Quote Link to comment Share on other sites More sharing options...
ketxu Posted July 29, 2011 Author Share Posted July 29, 2011 Ok, it's my way to solved the problem: (defun a ...) ;do sth (defun b...) ; do sth (defun C:doA nil (a)) ;call macro (defun C:doB nil (b)) ;call macro .... ;Defun to alert Unregistered (defun ST:Sys-Alert-Unregistered nil (alert "B\U+1EA1n ch\U+01B0a \U+0111\U+0103ng k\U+00FD n\U+00EAn kh\U+00F4ng s\U+1EED d\U+1EE5ng \U+0111\U+01B0\U+1EE3c l\U+1EC7nh n\U+00E0y :)")) (setq #ST:Key "080227BB0300WCC6MPUA1") ;this key is HDD serial with some encrypt to check with (defun ST:Sys-CheckKey (key) ...) ; this function to check key ;list all function use : (setq #funclst '(a b ....)) (if (not (ST:Sys-CheckKey #ST:key)) ;unregisterd (progn (mapcar '(lambda (x)(set x ST:Sys-Alert-Unregistered)) #funclst) ) ) Now if unregistered, all doA, doB.. command goto alert function ^^ BTW, haiz, please tell me which sysvar make alert function only display in commandline (dialog is disappear). I forgot it and can't to find out now 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.