method run(var eventInfo Event)
var
strWorkDir String ; Holds fully qualified working dir path.
fmMain Form ; Variable used to open the main menu form.
libApp Library ; Holds standard routines for application.
loStay Logical ; Inidactes whether or not to exit Paradox.
endVar
; global settings
setRetryPeriod( 0 )
ignoreCaseInStringCompares( Yes )
; define the required aliases for the application
strWorkDir = workingDir()
If strWorkDir.subStr( strWorkDir.size(), 1 ) = "\\" then
strWorkDir = strWorkDir.subStr( 1, strWorkDir.size() - 1 )
endIf
addProjectAlias( "MAIN", "Standard", strWorkDir )
addProjectAlias( "FORMS","Standard", strWorkDir + "\\FORMS" )
addProjectAlias( "RPTS", "Standard", strWorkDir + "\\RPTS" )
addProjectAlias( "LIBS", "Standard", strWorkDir + "\\LIBS" )
addProjectAlias( "DATA", "Standard", strWorkDir + "\\DATA" )
; addProjectAlias( "UTILS","Standard", strWorkDir + "\\UTILS" )
; addProjectAlias( "QBE", "Standard", strWorkDir + "\\QBE" )
; addProjectAlias( "DATAX","Standard", strWorkDir + "\\DATA" )
; addProjectAlias( "DOCS", "Standard", strWorkDir + "\\DOCS" )
; addProjectAlias( "SYS", "Standard", strWorkDir + "\\SYS" )
addProjectAlias( "PIX", "Standard", strWorkDir + "\\PIX" )
; start the application and wait for the user to exit.
If not fmMain.open( ":FORMS:DESKTOP" ) then
errorShow( "Can't Start Application",
"Reason: Could not open the Main Menu; see details..." )
else
loStay = fmMain.wait()
endIf
; Close all complex variable references, using techniques that
; avoid run-time errors.
If fmMain.isAssigned() then
try
fmMain.close()
onFail
; do nothing as the form is already closed
endTry
endIf
; Remain in Paradox or exit completely?
If not loStay then
exit()
endIf
endmethod