Steve-vfp9user
Programmer
Hi
I posted sometime back about creating folders for documents which works perfectly (thanks to those who contributed) on a standalone computer.
The purpose of the created folders is to store PDF's relating to job sheets, purchase orders etc that are automatically generated by the system.
The working command to create the folder is:
So this works as mentioned.
However, I now have two computers side by side that are networked via Ethernet cable with a view to using one as the server and the other as a networked computer.
Having installed the runtime files on both computer, the program runs efficiently on both but I have traced back where an error occurs on the networked computer where every time the coding asks to create folder or check if the folder exists the above coding throws up the error "Invalid path or file name". As there is no file (It's creating a folder) it must be the path.
The folder created ends up with a name as an example: 9-2023 Order Name Order Title
I am aware of SYS(0) but by adding that in front of the above e.g. IF NOT DIRECTORY(SYS(0)+"\"+SYS(2003)+"\"+.... it still throws up an error of "Invalid path or file name" on the networked computer.
As I know the code above works on a standalone with no errors, my question is, how do I differentiate the path name if someone is using the local machine as apposed to the networked computer or is there one command that covers both?
Any guidance would appreciated.
Thank you
Steve Williams
VFP9, SP2, Windows 10
I posted sometime back about creating folders for documents which works perfectly (thanks to those who contributed) on a standalone computer.
The purpose of the created folders is to store PDF's relating to job sheets, purchase orders etc that are automatically generated by the system.
The working command to create the folder is:
Code:
IF NOT DIRECTORY(SYS(2003)+"\"+LTRIM(STR(JOBYEAR))+" jobs\"+LTRIM(STR(JOBNUMB))+ ;
"-"+LTRIM(STR(JOBYEAR))+" "+ALLTRIM(ICOMPANY)+" "+ALLTRIM(JOBTITLE))
MKDIR(SYS(2003)+"\"+LTRIM(STR(JOBYEAR))+" jobs\"+LTRIM(STR(JOBNUMB))+ ;
"-"+LTRIM(STR(JOBYEAR))+" "+ALLTRIM(ICOMPANY)+" "+ALLTRIM(JOBTITLE))
ENDIF
So this works as mentioned.
However, I now have two computers side by side that are networked via Ethernet cable with a view to using one as the server and the other as a networked computer.
Having installed the runtime files on both computer, the program runs efficiently on both but I have traced back where an error occurs on the networked computer where every time the coding asks to create folder or check if the folder exists the above coding throws up the error "Invalid path or file name". As there is no file (It's creating a folder) it must be the path.
The folder created ends up with a name as an example: 9-2023 Order Name Order Title
I am aware of SYS(0) but by adding that in front of the above e.g. IF NOT DIRECTORY(SYS(0)+"\"+SYS(2003)+"\"+.... it still throws up an error of "Invalid path or file name" on the networked computer.
As I know the code above works on a standalone with no errors, my question is, how do I differentiate the path name if someone is using the local machine as apposed to the networked computer or is there one command that covers both?
Any guidance would appreciated.
Thank you
Steve Williams
VFP9, SP2, Windows 10