MarcoW Posted September 27, 2010 Posted September 27, 2010 Hi there, In a piece of code wich I have is this line: (setq FullFile (cons (strcat Path "\\" File) FullFile)) In the end it returns: "c:\program file\marcow\\test.lsp" This is obviously not good because the double "\" before "test.lsp" should be a single one. Now, if I delete this part "\\" it doesn't work, like this: (setq FullFile (cons (strcat Path File) FullFile)) Because I am in a learning process I only want to know if I need to search elsewhere to modify my code... I found out that when I modify this: >options>tab files>support file search paths>marcow\ into >options>tab files>support file search paths>marcow I do not need to modify the code at all, but since all my support file search paths end wit one "\" i figure I need to keep it that way.... This is bugging me now for sometime but I have no clue, please gimme a hint Quote
Lt Dan's legs Posted September 27, 2010 Posted September 27, 2010 (edited) try something like this (setq test (strcat (getvar 'roamablerootprefix) "Support\\" "test.lsp")) another test... (getfiled "Test" "" "lsp" notice how both come back with double backslashes Edited September 27, 2010 by Lt Dan's legs Quote
MarcoW Posted September 27, 2010 Author Posted September 27, 2010 LT Dan's Legs: thanks for the reply. Unfortunately I do not see what you mean. I noticed them coming up with double backslashes. This is my problem: "C:\program files\marcow\user\\marcow_linetypes.lin": Invalid file name. Should it be all double backslashes? Quote
Lt Dan's legs Posted September 27, 2010 Posted September 27, 2010 Yes they should. Forgive me, I'm known for being unclear. Something I'm working on does this work for you? (setq fullfile (findfile file)) assuming this file is in the support path Quote
alanjt Posted September 27, 2010 Posted September 27, 2010 Where is the 'path' variable coming from? Quote
Lee Mac Posted September 27, 2010 Posted September 27, 2010 (strcat (vl-string-translate "\\" "\\\\" Path) "\\" file) ? Quote
BlackBox Posted September 27, 2010 Posted September 27, 2010 Should it be all double backslashes? Yes. AutoCAD requires double-backslashes from LISP... For example: "C:\\program files\\marcow\\user\\marcow_linetypes.lin" *Unless* you were to use single forward-slashes. For example: Command: (findfile "C:/program files/marcow/user/marcow_linetypes.lin") "C:\\program files\\marcow\\user\\marcow_linetypes.lin" However, it is common practice to use double back-slashes. Quote
MarcoW Posted September 28, 2010 Author Posted September 28, 2010 Hello everybody, I have been searching why it always had worked in previous version of my programs and not anymore. In the end I found that my current support file search paths in options>files>support file search path> all end with a backslash. My previous program had them with no backslash in the end. I simply removed the backslashes of all of them and there seems to be no more problem. The problem is / was the 3rd backslash. I encounter no further problems due to missing backslashes so I think it is allright now. Thanks for all the help provided! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.