I have a lot of lisp routines that are started by the same name as the lisp name. i.e. file name caps.lisp is (defun c:caps ()........., met.lsp is (defun c:met ()........,any.lsp is (defun c:any.....etc. The name of the lisp file is the same as the string that must be entered to run it once it is loaded. In a tool macro (load "caps") caps would load and then run the caps lisp routine. I do not want to create a separate tool for each lisp routine, but rather one that will accept a variable name and the load the lisp routine using the variable name then run it using the same variable name. I've tried a macro like this: ((setq vname (getstring "\nFile Name to load: ")(load vname)) (vname)
The idea is that when I press the button the following prompt would appear
Command: File Name to load: enter: caps and this would load then run caps.lsp.
similarly
Command: File Name to load: enter: met and this would load then run met.lsp.
similarly
Command: File Name to load: enter: any and this would load then any any.lsp.
etc. all using the same tool.
------------------------------------------------------------------------------------------------------------------
Check out the history below
-------------------------------------------------------------------------------------------------------------------- Command: Command: (setq vname (getstring "\nFile to load And Run: "))(load vname)
File to load And Run: cap C:CAP
Command: cap
Select object: Command:
---------------------------------------------------------------------------------------------------------------------
This works great it loads the cap.lsp file using an alias vname....then I type in cap again and it runs the cap.lsp file.
I don't want to type in cap again I want to run cap by means of the same vname alias.
check the history below
------------------------------------------------------------------------------------------------------------------------
Command: Command: (setq vanme (getstring "\nFile to load And Run: "))(load vname)(vname)
File to load And Run: cap ; error: bad function: "cap"