Date: 02-16-2022
Return to Index
created by gbSnippets
'In gbEdit, the user can have an EXE run before the compiler takes
'effect. The pre-processor EXE can do anything the user wants, such as:
' modify the *.bas file
' create a test file
' verify current system features
'Basically, anything the user want. gbEdit will run the preprocessor,
'waiting until it completes to send the *.bas file to the compiler.
'This example create a preprocessor that simply adds a line to the
'*.bas file before sending it to the compiler.
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg as Dword
Function PBMain() As Long
Local temp$
temp$ = Command$
If MsgBox("Append date/time to file? " + temp$, %MB_OkCancel + %MB_IconQuestion, "gbEdit PreProcessor") = %IDOK Then
If IsFile(temp$) Then
Open temp$ for Append as #1
Print #1, $crlf + "#Utility Pre-Processor: " + Date$ + " " + Time$
Close #1
MsgBox "Line added to: " + temp$, %MB_Ok + %MB_IconInformation, "PreProcessor"
Else
MsgBox "Source code file not found: " + temp$, %MB_Ok + %MB_IconInformation, "PreProcessor"
End If
End If
End Function
CallBack Function DlgProc() As Long
End Function
'gbs_00756
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm