Message 1 of 4

Not applicable
10-11-2021
12:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I run this load file in the debugger and I run:
(LOADFILES "Z:\\Emmaus\\Auto CAD\\Emmaus-Lisps\\" "C:\\Emmaus-Lisps\\")
I immediately get an error that says "error: too many arguments". it doesn't even reach the first breakpoint line in the function. The function definition seems to only have two arguments so I am not sure why that is.
(defun loadFiles ( / srcDir destDir)
(setq filesList(list "bom.lsp" ; list of files to copy over.
"singleLine.lsp"
"smallUtilities.lsp"))
(setq loadLogFile (open (strcat destDir "load.log") "a"))
(write-line "Entered load.lsp" loadLogFile)
(if (/= foundSrcDrive "?")
(foreach flTmp filesList
(progn
(setq srcFile (strcat srcDir flTmp))
(setq destFile (strcat destDir flTmp))
(setq ret (vl-file-delete destFile)) ; must delete the local copy before copying
(setq ret (vl-file-copy srcFile destFile)) ; copy from the server to the local PC. Save the copy function return code.
(if (= nil ret) ; if the copy failed
(write-line (strcat "Warning or Error: Did not copy: " srcFile) loadLogFile) ; warning for acad.lsp, error for anything else
(progn
(write-line (strcat "Copied " srcFile " to " destFile) loadLogFile)
(load destFile (write-line (strcat "Failed to load: " destfile)))
) ; else success
)
)
)
; else the test file was not found on the server
(write-line (strcat "ERROR: Did not find test file: " (strcat srcDirNoDrv testFile) " to copy") loadLogFile)
)
(close loadLogFile)
)
Solved! Go to Solution.