Results 1 to 3 of 3

Thread: Loading Routines

  1. #1
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Loading Routines

    I am reviewing what I have done.
    I put two routines in one lsp file then comply it to vlx named as "1stVersion.vlx".
    Test_1 & Test_2 are the commands.
    I paste it to a search path & add a line in my "acaddoc2011.lsp".
    It works fine.
    But I found a problem when I enter this at command line:
    1)
    Code:
    (load "c:\\AutoLispStuff\\1stVersion.vlx")
    This should work but I receive the following message:
    nil
    2)
    I then try this at command line (load "c:\\LispStuff\\1stVersion") without the file extension "vlx"
    It returns:
    C:Test_2
    What is wrong?
    Thanks in advance.

  2. #2
    All AUGI, all the time marko_ribar's Avatar
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    557
    Login to Give a bone
    0

    Default Re: Loading Routines

    Nothing's wrong... vlx is behaving just like lsp : If you add 2 (defun c:XXX1 ()) & (defun c:XXX2 ()) functions, when lisp loads it will always show as result last one (c:XXX2), for it assumes that last one defined c:XXX function is main function for executing routine... This is why it's usually one lisp - one defined c:XXX function, and also the name of the lisp is usually the same as XXX function, so that you'll know what to load if you need that XXX function... This your 1stVersion.vlx should be named tests.vlx, and in (defun c:tests ()), you should point that you can use (c:test1) by entering (prompt "\nType \"test1\" for first test"), and also that you can use (c:test2) by entering (prompt "\nType \"test2\" for second test")...
    This is how should look your tests.lsp before compiling it in vlx :

    Code:
    (defun c:test1 ())
    (defun c:test2 ())
    ...
    (defun c:tests ()
    (prompt 1)
    (prompt 2)
    ...
    )
    M.R.

  3. #3
    AUGI Addict
    Join Date
    2006-04
    Location
    (getpoint "Anywhere on the Enter Key =>")
    Posts
    1,160
    Login to Give a bone
    0

    Default Re: Loading Routines

    Quote Originally Posted by marko_ribar View Post
    Nothing's wrong... vlx is behaving just like lsp : If you add 2 (defun c:XXX1 ()) & (defun c:XXX2 ()) functions, when lisp loads it will always show as result last one (c:XXX2), for it assumes that last one defined c:XXX function is main function for executing routine... This is why it's usually one lisp - one defined c:XXX function, and also the name of the lisp is usually the same as XXX function, so that you'll know what to load if you need that XXX function... This your 1stVersion.vlx should be named tests.vlx, and in (defun c:tests ()), you should point that you can use (c:test1) by entering (prompt "\nType \"test1\" for first test"), and also that you can use (c:test2) by entering (prompt "\nType \"test2\" for second test")...
    This is how should look your tests.lsp before compiling it in vlx :

    Code:
    (defun c:test1 ())
    (defun c:test2 ())
    ...
    (defun c:tests ()
    (prompt 1)
    (prompt 2)
    ...
    )
    M.R.
    Thanks.
    I just find out the only reason:
    Code:
    (princ)

Similar Threads

  1. Lisp routines not loading in 2013
    By thomas.stright in forum AutoLISP
    Replies: 1
    Last Post: 2012-09-04, 01:59 PM
  2. Loading LISP routines, is there a better way...
    By thomas.stright in forum AutoLISP
    Replies: 24
    Last Post: 2006-02-23, 05:00 PM
  3. Lisp routines not loading
    By stusic in forum AutoLISP
    Replies: 6
    Last Post: 2004-11-09, 06:39 AM
  4. Loading Lisp routines from a reactor
    By peter in forum AutoLISP
    Replies: 3
    Last Post: 2004-07-03, 03:11 PM

Posting Permissions

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