Article ID: 168058
Article Last Modified on 8/20/1999
-or-
CD "<path\directory containing app>"
* Are we running from a PRG (FXP)? If so, strip off all after the
* last 2 "\" characters else strip all after the last "\" character
CD (SUBSTR(SYS(16,0),1,RAT('\',SYS(16,0), ;
IIF(".FXP"$SYS(16,0),2,1))-1))
LPARAMETERS tcFileName
LOCAL lcFileName
lcFileName=ALLTRIM(tcFileName)
IF EMPTY(lcFileName)
RETURN .F.
ENDIF
lcFileName=LOWER(FULLPATH(lcFileName))
IF NOT "."$lcFileName
lcFileName=lcFileName+".mpr"
ENDIF
IF NOT FILE(lcFileName)
this.FileNotFoundMsgBox(lcFileName)
RETURN .F.
ENDIF
DO (lcFileName)
lcFileName=lcFileName+".mpr"to:
* Since the lowest level program is an FXP, we are not in an APP or EXE,
* so it is OK to look for MPR since we know source code is available.
* Otherwise look for MPX contained in APP or EXE
lcFileName = lcFileName+ iif(".FXP"$sys(16,0),".mpr", ".mpx")
MD c:\awtest
CD c:\awtest
USE HOME()+'wizards\appwiz.dbf'
BROWSE FOR type = 'STARTUP PROGRAM'
MODIFY MEMO DATA1
*<CD>*
CD (SUBSTR(SYS(16,0),1,RAT('\',SYS(16,0), ;
IIF(".FXP"$SYS(16,0),2,1))-1))
Keywords: KB168058