If my windows login name is HSIMPSON and i have created HSIMPSON.lsp in a Supported Directory, how do I load that Lisp file via the command line?
I have tried:
(load "loginname")
but that doesn't work because the 'load' command seems to want an explicit name, not a variable name.
Any suggestions?
Solved! Go to Solution.
Solved by pbejse. Go to Solution.
Thanks!
Just out of curiosity, what does the "Failed to Load" part do?
According to the help button:
Evaluates the AutoLISP expressions in a file
(load filename [onfailure])
onfailure
A value returned if load fails.
If the onfailure argument is a valid AutoLISP function, it is evaluated. In most cases, the onfailure argument should be a string or an atom. This allows an AutoLISP application calling load to take alternative action upon failure
Clear as mud eh? 🙂
HTH
@pbejse wrote:According to the help button:
Evaluates the AutoLISP expressions in a file
(load filename [onfailure])
onfailure
A value returned if load fails.
If the onfailure argument is a valid AutoLISP function, it is evaluated. In most cases, the onfailure argument should be a string or an atom. This allows an AutoLISP application calling load to take alternative action upon failure
A little warning here, the document is somewhat unclear. LOAD is an ordinary function, so it lives under normal Lisp evaluation rules: all the arguments are evaluated before the function is called.
So, if you have a function in the onfailure argument, it is always called regardless of whether there is a failure or not. The only difference is that in the failure case its result is returned as the value of the LOAD call.
So
(load "foo.lsp" (alert "FOO!"))
would always produce the alert even if foo.lsp loaded with no problems.
There is no special evaluation behaviour for the onfailure argument: if you pass it an actual function, it is just returned as such with no additional evaluation:
_$ (load "C:/temp/roska.lsp" alert)
@#<SUBR @24c07ad8 ALERT>
--
Thanks all. These responses are a little over my pay grade. But it's working, and thats what matters. Thanks!