#load

Discussion in 'AutoCAD' started by maryam, Jul 15, 2004.

  1. maryam

    maryam Guest

    I have a #load.lsp function , because I have another function that calls it however every time I load it i get the following message : ; error: bad argument type: stringp nil


    the function definition is the following ! any idea what is wrong with it ?


    ; #load - (function loader) - v10.2 - (c) 1990 Richard D. Howard
    ; loads function specified as par1
    ;
    ; parameters:
    ; par1 = file to load
    ;
    ; returns:
    ; return = value of last file statement
    ; return = nil = load failed
    ;
    ; functions:
    ; #filef = findfile util
    ;

    (if #filef ; if not function
    nil
    (progn
    (setq temp (strcat (getenv "lisp_lib") "#filef")) ; load function
    (load temp)
    );progn
    );if

    (defun #load (file / temp)
    (if (setq temp (#filef (strcat file ".lsp"))) ; if it exists
    (setq temp (load temp)) ; load it
    );if
    temp ; return value
    );#iload
     
    maryam, Jul 15, 2004
    #1
  2. maryam

    ECCAD Guest

    Problem may be: (getenv "lisp_lib") - IF environment variable
    "lisp_lib" is not defined / set to a value..To check it:
    (setq z (getenv "lisp_lib"))
    IF echo is nil, that variable is not set..
    IF echo is a string - filepath - then that is not the problem.

    Bob
     
    ECCAD, Jul 15, 2004
    #2
  3. maryam

    maryam Guest

    Bob
    I ran the command and I got nil, so I guess that is the problem. what should I do to fix it? can you be brief please
    thanks
    maryam
     
    maryam, Jul 15, 2004
    #3
  4. maryam

    ECCAD Guest

    The environment variable(s) are sometimes defined in the
    C:\autoexec.bat file - not always. Check there for 'lisp_lib'.
    IF not there, check your .mnl file for (setenv "lisp_lib" ...)
    IF not there, ask your IT person to check it out.

    Bob
     
    ECCAD, Jul 15, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.