Jump to content

[Help] Setq a function to another function ? What wrong ?


ketxu

Recommended Posts

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

Link to comment
Share on other sites

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

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...