findfile return nil
Hi all
I am trying to call and run another Lisp program from within my Lisp program.
However, I stumbled on the first step.
I have test1.lsp and MyLisp.lsp in AppData>Roaming>Bricsys>... >... >... >Support folder.
When I then run test1.lsp, it returns nil.
Why is this?
Thank you in advance.
test1.lsp
defun c:test1 (/ pas)
(setq pas (findfile "MyLisp.lsp"))
)
MyLisp.lsp
(defun c:MyLisp (/)
(princ "/nIn Supoprt Folder")
)
Comments
-
Hello.
Depending on the approach, different results can be displayed.
For example, if you first use the _APPLOAD command and load test1.lsp, and then use TEST1 at the command prompt, the path to MyLisp.lsp will be prompted.
0 -
what happens when you type "SUPPORTFOLDER" at the command line?
: (findfile "woohoo.lsp")
"C:\Users\Dan\AppData\Roaming\Bricsys\BricsCAD\V25x64\en_US\Support\woohoo.lsp"0 -
Sorry. I was mistaken.
When I put the two Lisp files in the Support folder and run test1.lsp, it successfully returned the Supprot folder.
However, when I put the two files in a faolder one folder below the Support folder, it returns nil.
Can I call the Lisp file's in the same folder as the executable?0 -
Hello.
For the script to find a file without specifying the full path, that file needs to be placed in a support folder.
If the folder containing the files is not a support folder, those files can only be found if the full path is used in the script.
For this case, the quickest solution seems to be to add the folder containing the files to the SRCHPATH system variable, to make it a support folder.
0 -
Why have your lisps in such a deep folder there is no reason why they can not be at a top level.
eg C:/Mylispprograms
Just as suggested add the C:/Mylispprograms to your support paths "Options Files Support …"
I have 7 support paths set up as need to check client programs at times.
lastly the directory can have sub folders think Lisp, Blocks, Icons & slides.
0