Files
flora2roa/main.prg
Marius Mutu 2736cbd525 Initial: flux text FoxBin2Prg (git urmareste .??2 in-arbore, binarele VFP git-ignored)
Include si sistemul de depanare/testare headless din Teste\ (harness UI cu capturi, verificare de sintaxa prin compilare, wrappere text<->binar) si docs\depanare_testare_flora2roa.md.
2026-08-02 08:56:52 +03:00

132 lines
2.9 KiB
Plaintext

#INCLUDE COMUN.H
#INCLUDE SECURITY.H
_screen.Icon= 'D:\PROIECTE\FLORA\FLORA2ROA\app.ico'
RELEASE MENU _Msysmenu
Close Databases All
Set Deleted On
Set Exclusive On
Set Ansi On
Set Exact On
Set Century On
Set Date Dmy
Set Safety Off
Private gcAppName, gcAppPath, gcTempPath
Local lcMesaj, lcOnShutdown, llSucces
PRIVATE goApp as "MyApp"
PRIVATE goLog as "Log"
Local lcFile, lcFileI, i
Local lcLibraryPath
Local loEx As Exception
gcAppName = 'FLORA2ROA'
gcAppPath = Addbs(Justpath(Sys(16,0)))
gcTempPath = GETENV("TEMP")
SET DEFAULT TO (gcAppPath)
lcOnShutdown="ShutDown()"
On Shutdown &lcOnShutdown
On Error ErrorHandler(Error(),Program(),Lineno())
SET PROCEDURE TO capp.prg ADDITIVE
SET PROCEDURE TO app.prg ADDITIVE
SET PROCEDURE TO myutils.prg ADDITIVE
SET PROCEDURE TO vfpconnection_utils.prg ADDITIVE
SET PROCEDURE TO myapp.prg ADDITIVE
llSucces = .F.
lcLibraryPath = m.gcAppPath + "vfpconnection.fll"
If File(lcLibraryPath)
llSucces = .F.
Try
Set Library To (lcLibraryPath) Additive
llSucces = .T.
Catch To loEx
lcMesaj = 'vfpconnection ' + loEx.Message
ShowMessage(m.lcMesaj)
Endtry
ENDIF
If m.llSucces
lcLibraryPath = m.gcAppPath + "vfpencryption.fll"
If File(lcLibraryPath)
llSucces = .F.
Try
Set Library To (lcLibraryPath) Additive
llSucces = .T.
Catch To loEx
lcMesaj = 'vfpencryption' + loEx.Message
ShowMessage(m.lcMesaj)
Endtry
Endif
ENDIF
***********************
PRIVATE goImportFrm, goConn, goExecutor
goImportFrm = NULL
goConn = CREATEOBJECT("oConn")
goExecutor = CREATEOBJECT("oExecutor")
goLog = Createobject("Log", gcApppath + "log\log_" + gcAppName + "_" + Dtos(Date()) + ".txt")
goApp = Createobject("MyApp")
*!* 02.03.2010
SetConnectTimeout(goApp.oSettings.connect_timeout) && Default is 10 seconds
SetResponseTimeout(goApp.oSettings.response_timeout) && Default is 10 seconds
*!* 02.03.2010 ^
DO FORM frm_import NAME goImportFrm LINKED
READ EVENTS
SHUTDOWN()
*************************
Procedure ShowMessage
Lparameters tcMessage
Messagebox(m.tcMessage)
Endproc
*************************
Function ErrorHandler(nError,cMethod,nLine)
Local lcErrorMsg,lcCodeLineMsg
Wait Clear
lcErrorMsg=Message()+Chr(13)+Chr(13)
lcErrorMsg=lcErrorMsg+"Method: "+cMethod
lcCodeLineMsg=Message(1)
If Between(nLine,1,10000) And Not lcCodeLineMsg="..."
lcErrorMsg=lcErrorMsg+Chr(13)+"Line: "+Alltrim(Str(nLine))
If Not Empty(lcCodeLineMsg)
lcErrorMsg=lcErrorMsg+Chr(13)+Chr(13)+lcCodeLineMsg
Endif
ENDIF
SET STEP ON
If Messagebox(lcErrorMsg,17,_Screen.Caption)#1
On Error
Return .F.
Endif
Endfunc
*************************
Function Shutdown
Cleanup()
Quit
Endfunc
*************************
Function Cleanup
On Error
On Shutdown
Set Classlib To
Set Path To
Clear All
Close All
*POP MENU _msysmenu
Return
ENDFUNC