- Aug
- 2,831
- 149
When TCC starts, it looks for a TCStart.btm.
If found, it executes TCStart.btm (Initialize).
When TCC ends, it looks for a TCExit.btm.
If found, it executes TCExit.btm (Terminate).
I would like that ability with .BTM files.
Example;
Output;
Thus, the BTM_Init routine would be automatically executed,
if it exists in the .BTM file being executed,
before any code in the .BTM is executed.
The BTM_Exit routine would be automatically executed,
if it exists in the .BTM file being executed,
after the last line of code in the .BTM is executed.[/CODE]
I sometimes use this method in Harbour programming,
and I have VBScript and JScript classes that use this method;
Joe
If found, it executes TCStart.btm (Initialize).
When TCC ends, it looks for a TCExit.btm.
If found, it executes TCExit.btm (Terminate).
I would like that ability with .BTM files.
Example;
Bash:
echo Before Init...
echo After Init...
echo Processing...
echo Before Exit...
echo After Exit...
quit
:BTM_Init
echo BTM_Init
Return
:BTM_Exit
echo BTM_Exit
Return
Output;
Bash:
BTM_Init
Before Init...
After Init...
Processing...
Before Exit...
After Exit...
BTM_Exit
Thus, the BTM_Init routine would be automatically executed,
if it exists in the .BTM file being executed,
before any code in the .BTM is executed.
The BTM_Exit routine would be automatically executed,
if it exists in the .BTM file being executed,
after the last line of code in the .BTM is executed.[/CODE]
I sometimes use this method in Harbour programming,
and I have VBScript and JScript classes that use this method;
Bash:
Class VFP9
Private objVFP
Private Sub Class_Initialize()
Set objVFP = CreateObject("VisualFoxPro.Application.9")
End Sub
Public Function Eval(arg1)
Eval = objVFP.Eval(arg1)
End Function
Function Version()
Version = objVFP.Version
End Function
Private Sub class_Terminate()
objVFP.Quit()
Set objVFP = Nothing
End Sub
End Class
Joe