Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Development Pathing Issue
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01015635
Message ID:
01015757
Views:
15
#DEFINE APP_PATH_1 d:\projects\vfp1\{project}\{version}\source.
#DEFINE APP_PATH_2 g:\vfp1\{project}\{version}\source.


Since the relative paths are the same, why not use a generic SetPath() function that you app can call from its main startup prohgram to work out the path where ever you are:
*******************************************************************
FUNCTION SetPath()
*******************************************************************
LOCAL lcSys16, lcProgram, lcPath

  *** Grab name of program that called this one.
  lcSys16 = SYS( 16, 1 )
  lcProgram = JUSTFNAME( lcSys16 )
  
  *** Change to the directory that the program is in  
  CD JUSTPATH( lcSys16 )

  *** If we are running the main program directly, then
  *** CD up to the parent directory
  IF JUSTEXT( lcProgram ) = "FXP"
    CD ..
  ENDIF
  
  *** Go ahead and set the path
  IF VERSION(2) # 0
    ***  We are in Development Mode
    ***  Set up Project search path
    lcPath = HOME() + ';' + FULLPATH( CURDIR() ) + [;form;libs;include;menu;data;prog;report;graphics]
  ELSE
    *** We are in Production Mode
    *** Set up application search path
    lcPath = HOME() + ';' + FULLPATH( CURDIR() ) + [;data;report;graphics]
  ENDIF    

  SET PATH TO ( lcPath )

  *** and the classlibs
  SET CLASSLIB TO application, BaseForm, BaseCtrl, stdCustom, DataContainer ADDITIVE
  SET PROCEDURE TO GlobalProcs ADDITIVE 
 
ENDFUNC
Previous
Reply
Map
View

Click here to load this message in the networking platform