Sam Jones Posted January 16, 2017 Share Posted January 16, 2017 Is there a way to create a finder folder in which to put the text files that one is writing. I need to save a file in the user plug-ins folder. I would normally do this by: PlugInPath := GetFolderPath(-2); FeederFile := CONCAT(PlugInPath,'FEEDER INVENTORY.xml’); {… stuff …} result := WriteXMLFile(hXML, -1, FeederFile); But there will several files, so I tried: PlugInPath := GetFolderPath(-2); FeederFile := CONCAT(PlugInPath,’Inventory Folder:FEEDER INVENTORY.xml’); {<——Change is here} {… stuff …} result := WriteXMLFile(hXML, -1, FeederFile); That did not seem to work. Any suggestions? TIA Sam Quote Link to comment
MullinRJ Posted January 17, 2017 Share Posted January 17, 2017 (edited) Sam, This should work. The first time you use it a folder will be created in your Plug-ins folder. After that, new files will be placed in that folder. If you need to delete a folder when you're done with it, you'll probably need to use Python. PROCEDURE CreateFileInNewFolder; { This program will create a new file AND a new folder, if it doesn't already exist, } { in the User's Plug-ins folder. } VAR parentF, XMLFolder, FName1 :String; BEGIN parentF := GetFolderPath(-2); XMLFolder := 'New XML ƒ:'; { using Mac file delimiter } FName1 := concat(parentF, XMLFolder, 'FEEDER INVENTORY.xml'); ReWrite(FName1); WriteLn('Sam, I''m in here!!!'); Close(FName1); END; RUN(CreateFileInNewFolder); HTH, Raymond Edited January 17, 2017 by MullinRJ Quote Link to comment
MullinRJ Posted January 18, 2017 Share Posted January 18, 2017 Sam, I see there is more to the problem than creating a new folder. I played with the XML part tonight and realize the FileIO calls have more flexibility than the XML-IO calls regarding paths. I'll look at it again tomorrow, but it will be later in the day. Perhaps Carlotta will chime in with her infinite wisdom regarding all things XML. Raymond Quote Link to comment
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.