+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Senior Member ketxu's Avatar
    Computer Details
    ketxu's Computer Details
    Operating System:
    Sorry, my English not well :(
    Computer:
    Sorry, my English not well :(
    Motherboard:
    Sorry, my English not well :(
    CPU:
    Sorry, my English not well :(
    RAM:
    Sorry, my English not well :(
    Graphics:
    Sorry, my English not well :(
    Primary Storage:
    Sorry, my English not well :(
    Secondary Storage:
    Sorry, my English not well :(
    Monitor:
    Sorry, my English not well :(
    Using
    AutoCAD 2007
    Join Date
    Sep 2010
    Location
    Sorry, my English not well :(
    Posts
    169

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

    Registered forum members do not see this ad.

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

  2. #2
    Senior Member ketxu's Avatar
    Computer Details
    ketxu's Computer Details
    Operating System:
    Sorry, my English not well :(
    Computer:
    Sorry, my English not well :(
    Motherboard:
    Sorry, my English not well :(
    CPU:
    Sorry, my English not well :(
    RAM:
    Sorry, my English not well :(
    Graphics:
    Sorry, my English not well :(
    Primary Storage:
    Sorry, my English not well :(
    Secondary Storage:
    Sorry, my English not well :(
    Monitor:
    Sorry, my English not well :(
    Using
    AutoCAD 2007
    Join Date
    Sep 2010
    Location
    Sorry, my English not well :(
    Posts
    169

    Default

    Please don't mind. I've solded this problem with set and mapcar lambda. Thanks for reading ^^

  3. #3
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,932

    Default

    Quote Originally Posted by ketxu View Post
    I've solded this problem with set and mapcar lambda.
    Could you please post code?

    Thanks.
    "Potential has a shelf life." - Margaret Atwood

  4. #4
    Senior Member ketxu's Avatar
    Computer Details
    ketxu's Computer Details
    Operating System:
    Sorry, my English not well :(
    Computer:
    Sorry, my English not well :(
    Motherboard:
    Sorry, my English not well :(
    CPU:
    Sorry, my English not well :(
    RAM:
    Sorry, my English not well :(
    Graphics:
    Sorry, my English not well :(
    Primary Storage:
    Sorry, my English not well :(
    Secondary Storage:
    Sorry, my English not well :(
    Monitor:
    Sorry, my English not well :(
    Using
    AutoCAD 2007
    Join Date
    Sep 2010
    Location
    Sorry, my English not well :(
    Posts
    169

    Default

    Registered forum members do not see this ad.

    Ok, it's my way to solved the problem:

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

Similar Threads

  1. Something is wrong with my polar function
    By harrison-matt in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 16th Apr 2011, 05:10 pm
  2. Replies: 11
    Last Post: 25th Nov 2010, 02:06 am
  3. Keeping track of variables function to function day to day
    By Hudson in forum AutoLISP, Visual LISP & DCL
    Replies: 7
    Last Post: 27th Aug 2009, 06:13 pm
  4. Mod function
    By cim123 in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 23rd Oct 2007, 02:21 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts