-1

I am trying to set up the environment for VFP for an app I have tried SET DEFAULT & SET PATH TO I have also tried to use Environment Manager to all the directories of the prodject but when I run the program I have to use the locate dialog to find the files that the programe needs, main programme sets the environment I think, the code looks like this

 CLOSE DATABASES ALL
 CLOSE TABLE ALL
 SET SYSMENU OFF
 SET STATUS OFF
 SET STATUS BAR OFF
 _VFP.autoyield = .F.
 IF FILE("c:\pb1\photobooth\photographer.exe")
    SET DEFAULT TO c:\pb1\photobooth
 ELSE
    ON ERROR DO FORM FORMS\errorfrm WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
 ENDIF
 SET PATH TO ..\CommandBars\Redistr,..\wwclient\,..\sfquery,..\classes,..\wwclient\classes, c:\sdt\sdt\source,c:\sdt\sdt\,..\xfrx,..\xfrx\xfrxlib
 SET CLASSLIB TO (HOME()+"ffc\_reportlistener")
 SET PROCEDURE TO PROGS\procfile ADDITIVE
 SET PROCEDURE TO ..\xfrx\utilityreportlistener.prg ADDITIVE
 SET PROCEDURE TO wwUtils ADDITIVE
 SET PROCEDURE TO wwEval ADDITIVE
 SET PROCEDURE TO CodeBlockClass ADDITIVE <-----
 SET CLASSLIB TO wwIPStuff ADDITIVE
 SET CLASSLIB TO wwXML ADDITIVE
 SET PROCEDURE TO wwHTTP ADDITIVE
 SET PROCEDURE TO WWPOP3 ADDITIVE
 SET STATUS BAR ON
 SET DATE BRITISH
 SET DELETED ON
 SET SAFETY OFF
 SET MULTILOCKS ON
 ON KEY LABEL SHIFT+F1 gl_diag=!gl_diag

I am looking for a way to run the programme with out errors so that I can find out why the app is not parsing all data to an XML file Tamar has provided a goog guide to debugging I just need to run the programme to the point the XML get generated. the errors start at the point indicated by the arrow

Artful_dodger
  • 698
  • 2
  • 7
  • 26
  • Have you checked whether the file CodeBlockClass.PRG exists in the path? – Tamar E. Granor Aug 22 '13 at 20:46
  • Interesting. The list of folders on the path are all for third-party tools. Is all the code for the application other than third-party stuff in a single folder? If not, you need to get those folders into the path as well. – Tamar E. Granor Aug 22 '13 at 20:48
  • I have put them in the path using SET PATH TO and using Environment Manager to get the main program to work I have changed CodeBlockClass to ..\photobooth\PROGS\CodeBlockClass because whilste trying to debug I found the HOME() was set to c:\PROGRAM FILES\microsoft vfp\ folder in the tutorials I hve done that did not happen I check the path was correct with ?SET('Path') aslo tried DISPLAY STATUS that was set in ENVIRONMENT MANAGER all were set correctly – Artful_dodger Aug 22 '13 at 21:40
  • sorry Tanar in my eagerness to start debugging the is miss raedy what you said today I have reviewed every thing and noted all the directories that have files in I have also noted that there is no directory called programs so I have modified the main program as above – Artful_dodger Aug 23 '13 at 15:19
  • Hi Tamar I made a fundamental error, I wrongly assumed that the IDE would retain the SET PATH TO parameters that I set but when I checked with ?SET("path") on only got back on line 12 of the main program so I have commented out line 12 for now so hopefully I can read your paper on debugging and put it use Cheers – Artful_dodger Aug 25 '13 at 13:58

1 Answers1

1

If the main program is setting the environment, you will likely be overwriting some of the settings by not using the ADDITIVE keyword. In your example, it looks like this is the case for SET PATH and SET CLASSLIB.

Example One - without ADDITIVE

*--- Main program
SET PATH TO "C:\VFP9"

*--- Debug setup
SET PATH TO "D:\Debug"
?set('Path')

Output: D:\Debug

Example Two - with ADDITIVE

*--- Main program
SET PATH TO "C:\VFP9"

*--- Debug setup
SET PATH TO "D:\Debug" ADDITIVE
?set('Path')

Output: D:\Debug;C:\VFP9

  • 1
    I personally have always HATED "SET PATH" because if you have (by accident), same file names in different paths (including .dbf files), and try to "use" a file, or create an instance of a class, VFP finds which ever instance first in a path and could be the wrong version you are expecting. – DRapp Jan 09 '15 at 17:42