PDA

View Full Version : Going from "\\" to "\"



madcadder
2007-01-08, 07:53 PM
Just for testing...

I have a routine that starts:



...(SETQ |foldername| (GETSTRING "Enter New Folder Name: "))
(SETQ |path| "M:\\Customer Files\\Inquiry Number\\")
(SETQ |projectname| (STRCAT |path| |foldername|))
(DOS_MKDIR |projectname|)...

Which works beautifully to create that folder.

Now I am going to switch to DOS_REGSETSTR and set the path in the NEWSHEETSET wizard to this project name string.


(DOS_REGSETSTR "HKEY_CURRENT_USER" "Software\\Autodesk\\AutoCAD\\R17.0\\ACAD-5004:409\Profiles\AutoCAD\Dialogs\Sheet Set Wizard" "SheetSetCreatePath" |projectname|)

This does not work because the string is still "\\" and I only need one slash.
I'd swear that I've seen a thread on how to convert "\\" to "\", but I can't find it.

Would someone be so kind as to point me back to that thread?

rkmcswain
2007-01-08, 08:34 PM
Is DOSLIB doing something weird with the slash marks?

Can you just use (vl-registry-write) instead?



(vl-registry-write reg-key [val-name val-data])

madcadder
2007-01-08, 08:53 PM
I think that may work, but I'll have to consult with F1 a little on this one. I'm still more of a LISPer than a VLISPer.


Thanks

Ogre
2007-01-08, 09:36 PM
Use forward slashes???

abdulhuck
2007-01-09, 05:21 AM
(DOS_REGSETSTR "HKEY_CURRENT_USER" "Software\\Autodesk\\AutoCAD\\R17.0\\ACAD-5004:409\Profiles\AutoCAD\Dialogs\Sheet Set Wizard" "SheetSetCreatePath" |projectname|)

This does not work because the string is still "\\" and I only need one slash.
I'd swear that I've seen a thread on how to convert "\\" to "\", but I can't find it.

Would someone be so kind as to point me back to that thread?Please try this:


(setq Hive "HKEY_CURRENT_USER"
Key "Software\\Autodesk\\AutoCAD\\R17.0\\ACAD-5004:409\\Profiles\\AutoCAD\\Dialogs\\Sheet Set Wizard"
Name "SheetSetCreatePath"
)
(DOS_REGSETSTR Hive Key Name |projectname|)


I did not test it but I feel that the error could be because you missed out some slashes (see the red ones) in your code. If you load the code, and (princ Key) will give you only one slash.

Regards,
Abdul Huck