Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why file does not exist? 4

Status
Not open for further replies.

icecr3amc4k3

Programmer
Apr 25, 2023
7
ID
hi everyone i have a question
why this file form3 and form2.csx does not exist?
Screenshot_57_puq1uz.png

Screenshot_58_gwfwop.png

did my code wrong? yesterday when i was run the code and is work,but now is not..

thanks
 
Clearly, the file does exist. But whatever code you use, may it be a FILE() function call, may it be DO FORM, it does not look everywhere on your hard drive.

So this is most likely a case of code only working, if you have the correct CD or SET DEFAULT before running it. Let me guess, your command1 button has the code DO FORM form2.scx. Well, if your current directory then isn't the directory of form2, then it's not found and you get this error.

Chriss
 
It's good practice to SET PATH at the start of your program, to point to the directories where your various forms, reports, class libraries, etc. ar stored,

I usually store those files in sub-directories off the root directory for the project. Something like this:

Code:
SET DEFAULT TO JUSTPATH(SYS(16)
SET PATH TO forms, reports, code, classes, data


SYS(16) returns the path and name of the directory from which you launch the program (which then becomes the root of your development directories). Forms, Reports, etc. are all sub-directories of the default.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top