home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
chip
/
tvgenpas
/
demo3pas.exe
/
TEMPLATE
/
APP.ATF
next >
Wrap
Text File
|
1995-02-04
|
18KB
|
751 lines
\ ********************************************************
\ Standard application template file for TVGen 3.0
\ (c) 1994 BOCIAN Software
\ ********************************************************
\ Procedures LineProc and ObjParams are used in dialogs. Placing them
\ here eliminates redefining when each dialog is about to be generated
\ Recursively called procedure building up the cluster string lists
@DEFPROC LineProc
@IF!EQUAL %_LINETEXT% ''
@IFOPTION STR_IN_RSC
NewSItem(%_LINETEXT%,
@ELSE
NewSItem('%_LINETEXT%',
@ENDIF
@NEXTLINE Lines
@CALL LineProc
@NOCR )
@ELSE
@NOCR nil
@ENDIF (if!equal)
@ENDPROC
\ End of procedure LineProc
\ Recursively called procedure building up the cluster hints list
@DEFPROC HintsProc
@IF!EQUAL %_LINETEXT% ''
@IFOPTION HELP
@IF!EQUAL %__HELPFLAG% 0
@PUSHFILE 4
@NOCR ,%_SUBSTR(__HCVAL,1,2)%%__HCCOUNTER%
@POPFILE
@ENDIF (if!equal)
@ENDIF
S.Put(hc_D_%_DLGFUNC(_DLGNUM)%+%__HCCOUNTER%,'%_LINETEXT%');
@INC __HCCOUNTER
@INC __HINTCOUNTER
@NEXTLINE Hints
@CALL HintsProc
@ENDIF (if!equal)
@ENDPROC
\ End of procedure HintsProc
\ Procedure for object flags redefinition
@DEFPROC ObjParams
@IF!DEFAULT Options
%_PARAMETER(1)%.Options:=%OPTIONS%;
@ENDIF
@IF!DEFAULT DragMode
%_PARAMETER(1)%.DragMode:=%DRAGMODE%;
@ENDIF
@IF!DEFAULT GrowMode
%_PARAMETER(1)%.GrowMode:=%GROWMODE%;
@ENDIF
@IF!DEFAULT EventMask
%_PARAMETER(1)%.EventMask:=%EVENTMASK%;
@ENDIF
\ Has the object defined HINT field?
@IFFIELD HINT
@IFOPTION HELP
@IF!EQUAL %__HELPFLAG% 0
@PUSHFILE 4
@NOCR ,%_SUBSTR(__HCVAL,1,2)%%__HCCOUNTER%
@POPFILE
@ENDIF (if!equal)
@ENDIF
\ Differs hint-text from the null string?
@IF!EQUAL %HINT% ''
\ File @5 is the application resource maker
%_PARAMETER(1)%.HelpCTX:=hc_D_%_DLGFUNC(_DLGNUM)%+%__HCCOUNTER%;
@PUSHFILE 5
S.Put(hc_D_%_DLGFUNC(_DLGNUM)%+%__HCCOUNTER%,%HINT%);
@INC __HCCOUNTER
@INC __HINTCOUNTER
@POPFILE
@ENDIF (if!equal)
@ENDIF (iffield)
\ Has the object defined HINTS field?
@IFFIELD HINTS
%_PARAMETER(1)%.HelpCTX:=hc_D_%_DLGFUNC(_DLGNUM)%+%__HCCOUNTER%;
@FIRSTLINE Hints
@PUSHFILE 5
@CALL HintsProc
@POPFILE
@ENDIF
@ENDPROC
\ End of procedure ObjParams
\
\
@DEFPROC AppDialogCall
@ASSIGN __DLGNUMBER %_GETDLGNUM(_PARAMETER(1))%
@IF!EQUAL %__DLGNUMBER% 0
@IFEQUAL %_DLGDATAFLAG(__DLGNUMBER)% 0
Result:=%_DLGFUNC(__DLGNUMBER)%;
@ELSE
Result:=%_DLGFUNC(__DLGNUMBER)%(%_PARAMETER(2)%,False);
@ENDIF
@ENDIF
@ENDPROC
\ End of procedure AppDialogCall
\
@DEFPROC AppDialogData
@ASSIGN __DLGNUMBER %_GETDLGNUM(_PARAMETER(1))%
var Result : Word;
@IF!EQUAL %__DLGNUMBER% 0
@IF!EQUAL %_DLGDATAFLAG(__DLGNUMBER)% 0
%_PARAMETER(2)% : T%_DLGFUNC(__DLGNUMBER)%Data;
@ENDIF
@ENDIF
@ENDPROC
\ End of procedure AppDialogData
\
\ END OF PROCEDURE SECTION
\
\
@ASSIGN __HINTCOUNTER 0
@ASSIGN __MAKEIDLE 0
@ASSIGN __LOADGADGETS 0
@IFOPTION CLOCK
@INC __MAKEIDLE
@INC __LOADGADGETS
@ENDIF
@IFOPTION HEAPVIEW
@INC __MAKEIDLE
@INC __LOADGADGETS
@ENDIF
@IFOPTION ScreenSaver
@INC __MAKEIDLE
@ENDIF
@DEFINEFILE 2 %_OUTFILE%.PAS
@DEFINEFILE 3 %_SUBSTR(_OUTFILE,1,6)%_D.PAS
@IFOPTION HELP
@DEFINEFILE 4 %_OUTFILE%.TXT
@ENDIF
@DEFINEFILE 5 %_SUBSTR(_OUTFILE,1,6)%_R.PAS
@IFOPTION DLG_IN_RSC
@DEFINEFILE 6 %_SUBSTR(_OUTFILE,1,6)%_R.INC
@ASSIGN __OBJTYPES 0
@ENDIF
\ Dialog data exchange types
@FILE 3
unit %_SUBSTR(_OUTFILE,1,6)%_D;
interface
uses Objects;
\ Resource maker
@FILE 5
program Resource_Maker;
@NOCR uses App, Dialogs, Drivers, Editors, Objects, Menus, %_SUBSTR(_OUTFILE,1,6)%_H, %_SUBSTR(_OUTFILE,1,6)%_C, Views, Supply3
@IF!EQUAL %_UNITS% ''
,
%_UNITS%;
@ELSE
;
@ENDIF
{$DEFINE RscMaker}
var
ResFile : TResourceFile;
S : TStrListMaker;
R : TRect;
const
AverageHintSize = 70; { 70 bytes per hint text }
procedure DefineHints(var S : TStrListMaker);
begin
\ Dialogs
@DEFINEFILE 7 %_SUBSTR(_OUTFILE,1,6)%_K.INC
@FORALLDIALOGS
@DIALOG
@ENDFOR
@CLOSEFILE 7
\ Main program file
@FILE 2
{$X+}
program %_OUTFILE%;
uses App, Dialogs, Dos, Drivers, Editors, Menus, MsgBox, Objects,
@NOCR StdDlg, Supply3, Views, HelpFile,
@IF!EQUAL %_UNITS% ''
@NOCR %_UNITS%,
@ENDIF
@IFOPTION ASK_FOR_UNITS
@ASKFOR __USERUNITS '' 'User units'
@IFEQUAL %__USERUNITS% ''
@NOCR %_SUBSTR(_OUTFILE,1,6)%_H, %_SUBSTR(_OUTFILE,1,6)%_C, %_SUBSTR(_OUTFILE,1,6)%_D
@ELSE
@NOCR %__USERUNITS%, %_SUBSTR(_OUTFILE,1,6)%_H, %_SUBSTR(_OUTFILE,1,6)%_C, %_SUBSTR(_OUTFILE,1,6)%_D
@ENDIF
@ELSE
@NOCR %_SUBSTR(_OUTFILE,1,6)%_H, %_SUBSTR(_OUTFILE,1,6)%_C, %_SUBSTR(_OUTFILE,1,6)%_D
@ENDIF (ifoption)
@IF!EQUAL %__LOADGADGETS% 0
@NOCR ,Gadgets
@ENDIF
;
type
%_APPTYPE% = object(TApplication)
@IFOPTION Clock
Clock : PClockView;
@ENDIF
@IFOPTION HeapView
HeapView : PHeapView;
@ENDIF
@IFOPTION ScreenSaver
ScreenSaver : PScreenSaver;
@ENDIF
@IFSNIPPET MTD_INIT
constructor Init;
@ENDIF
\ AdditionalInit method handles setup of Clock, HeapView, ScreenSaver, etc.
procedure AdditionalInit;
@IFSNIPPET MTD_DONE
destructor Done; virtual;
@ENDIF
\ Always override HandleEvent and InitStatusLine methods
procedure HandleEvent(var Event : TEvent); virtual;
procedure InitStatusLine; virtual;
@IFMENUBAR
procedure InitMenuBar; virtual;
@ENDIF
@IFOPTION HELP
procedure GetEvent(var Event : TEvent); virtual;
@ELSE
@IFOPTION ScreenSaver
procedure GetEvent(var Event : TEvent); virtual;
@ENDIF
@ENDIF
@IF!EQUAL %__MAKEIDLE% 0
procedure Idle; virtual;
@ENDIF
@IFOPTION HELP
function GetPalette : PPalette; virtual;
@ELSE
@IFOPTION COLOR
function GetPalette : PPalette; virtual;
@ENDIF
@ENDIF
@FORCALLEDDIALOGS
procedure Call%_DLGFUNC(_DLGNUM)%;
@ENDFOR
@ASSIGN __SECTION 'HEADER'
@SNIPPETS LIKE USR_*
@ASSIGN __SECTION 'MAIN'
end;
var ResFile : TResourceFile;
@FORALLDIALOGS
@IF!EQUAL %_DLGDATAFLAG(_DLGNUM)% 0
function %_DLGFUNC(_DLGNUM)%(var _Data : T%_DLGFUNC(_DLGNUM)%Data; _SetData : Boolean): Word; forward;
@ELSE
function %_DLGFUNC(_DLGNUM)%: Word; forward;
@ENDIF
@ENDFOR
\ Generate StatusLine
@IFSTATUS
@PUSHFILE
@STATUSLINE
@POPFILE
@IF!OPTION STATUS_IN_RSC
{$I %__STATUSFILE%}
@ELSE
procedure %_APPTYPE%.InitStatusLine;
var R : TRect;
begin
GetExtent(R);
R.A.Y:=R.B.Y-1;
StatusLine:=PHintStatusLine(ResFile.Get('STATUSLINE'));
if StatusLine<>nil then
begin
StatusLine^.ChangeBounds(R);
PHintStatusLine(StatusLine)^.NewHintList(PStringList(ResFile.Get('HINTS')));
end;
end;
@ENDIF (if!option)
@ELSE
\ StatusLine is not defined - initialize THintStatusLine with standard keys
procedure %_APPTYPE%.InitStatusLine;
var R : TRect;
begin
GetExtent(R);
R.A.Y:=R.B.Y-1;
StatusLine:=New(PHintStatusLine, Init(R,
NewStatusDef(0, $FFFF,
NewStatusKey('~Alt-X~ Exit', kbAltX, cmQuit,
@IFOPTION TP6
NewStatusKey('', kbF10, cmMenu,
NewStatusKey('', kbAltF3, cmClose,
NewStatusKey('', kbF5, cmZoom,
NewStatusKey('', kbCtrlF5, cmResize,
NewStatusKey('', kbF6, cmNext,nil)))))),nil)));
@ELSE
StdStatusKeys(nil)), nil)));
@ENDIF
PHintStatusLine(StatusLine)^.NewHintList(PStringList(ResFile.Get('HINTS')));
end;
@ENDIF (ifstatus)
\ Generate MenuBar
@IFMENUBAR
@PUSHFILE
@MENUBAR
@POPFILE
@IF!OPTION MENU_IN_RSC
{$I %__MENUFILE%}
@ELSE
procedure %_APPTYPE%.InitMenuBar;
var R : TRect;
begin
GetExtent(R);
R.B.Y:=R.A.Y+1;
MenuBar:=PMenuBar(ResFile.Get('MENUBAR'));
if MenuBar<>nil then MenuBar^.ChangeBounds(R);
end;
@ENDIF (if!option)
@ENDIF (ifmenubar)
@IF!EQUAL %__MAKEIDLE% 0
procedure %_APPTYPE%.Idle;
begin
@IFOPTION TP6
TApplication.Idle;
@ELSE
inherited Idle;
@ENDIF
@IFOPTION CLOCK
Clock^.Update;
@ENDIF
@IFOPTION HEAPVIEW
HeapView^.Update;
@ENDIF
@IFOPTION ScreenSaver
ScreenSaver^.Update;
@ENDIF
end;
@ENDIF
procedure %_APPTYPE%.AdditionalInit;
var R : TRect;
begin
@IFOPTION ScreenSaver
GetExtent(R);
@ASKFOR __SSDelay '60' 'Screen saver delay in seconds'
@IFEQUAL %__SSDelay% ''
New(ScreenSaver,Init(R,60));
@ELSE
New(ScreenSaver,Init(R,%__SSDELAY%));
@ENDIF
Insert(ScreenSaver);
@ENDIF
@IFOPTION CLOCK
GetExtent(R);
R.A.X:=R.B.X-9;
R.B.Y:=R.A.Y+1;
Clock:=New(PClockView,Init(R));
Insert(Clock);
@ENDIF
@IFOPTION HEAPVIEW
GetExtent(R);
R.A.X:=R.B.X-7;
R.A.Y:=R.B.Y-1;
R.Move(-1,0);
HeapView:=New(PHeapView,Init(R));
Insert(HeapView);
@ENDIF
end;
@IFOPTION HELP
procedure %_APPTYPE%.GetEvent;
var
W: PWindow;
HFile: PHelpFile;
HelpStrm: PDosStream;
C : Word;
const
HelpInUse: Boolean = False;
function CalcHelpName: PathStr;
var
EXEName: PathStr;
Dir: DirStr;
Name: NameStr;
Ext: ExtStr;
begin
EXEName := ParamStr(0);
FSplit(EXEName, Dir, Name, Ext);
if Dir[Length(Dir)] = '\' then Dec(Dir[0]);
CalcHelpName := FSearch('%_OUTFILE%.HLP', Dir);
end;
begin
TApplication.GetEvent(Event);
@IFOPTION ScreenSaver
ScreenSaver^.CheckEvent(Event);
@ENDIF
case Event.What of
evCommand:
if (Event.Command = cmHelp) and not HelpInUse then
begin
HelpInUse := True;
HelpStrm := New(PDosStream, Init(CalcHelpName, stOpenRead));
HFile := New(PHelpFile, Init(HelpStrm));
if HelpStrm^.Status <> stOk then
begin
MessageBox('Could not open help file.', nil, mfError + mfOkButton);
Dispose(HFile, Done);
end
else
begin
W := New(PHelpWindow,Init(HFile, GetHelpCtx));
if ValidView(W) <> nil then
begin
W^.HelpCTX:=hcHelpWindowActive;
ExecView(W);
Dispose(W, Done);
end;
ClearEvent(Event);
end;
HelpInUse := False;
end;
end;
end;
function %_APPTYPE%.GetPalette : PPalette;
const
@IFOPTION TP6
@IFOPTION COLOR
@NOCR CNewColor =
@TPCOLORS 1 ' '
@ELSE
CNewColor = CColor + CHelpColor;
@ENDIF
CNewBlackWhite = CBlackWhite + CHelpBlackWhite;
CNewMonochrome = CMonochrome + CHelpMonochrome;
@ELSE
@IFOPTION COLOR
@NOCR CNewColor =
@TPCOLORS 2 ' '
@ELSE
CNewColor = CAppColor + CHelpColor;
@ENDIF
CNewBlackWhite = CAppBlackWhite + CHelpBlackWhite;
CNewMonochrome = CAppMonochrome + CHelpMonochrome;
@ENDIF
P: array[apColor..apMonochrome] of string[Length(CNewColor)] =
(CNewColor, CNewBlackWhite, CNewMonochrome);
begin
GetPalette := @P[AppPalette];
end;
@ELSE (ifoption help)
@IFOPTION ScreenSaver
procedure %_APPTYPE%.GetEvent;
begin
@IFOPTION TP6
TApplication.GetEvent(Event);
@ELSE
inherited GetEvent(Event);
@ENDIF
ScreenSaver^.CheckEvent(Event);
end;
@ENDIF
@IFOPTION COLOR
function %_APPTYPE%.GetPalette : PPalette;
const
@IFOPTION TP6
@IFOPTION COLOR
@NOCR CNewColor =
@TPCOLORS 1 ' '
@ELSE
CNewColor = CColor + CHelpColor;
@ENDIF
CNewBlackWhite = CBlackWhite + CHelpBlackWhite;
CNewMonochrome = CMonochrome + CHelpMonochrome;
@ELSE
@IFOPTION COLOR
@NOCR CNewColor =
@TPCOLORS 2 ' '
@ELSE
CNewColor = CAppColor + CHelpColor;
@ENDIF
CNewBlackWhite = CAppBlackWhite + CHelpBlackWhite;
CNewMonochrome = CAppMonochrome + CHelpMonochrome;
@ENDIF
P: array[apColor..apMonochrome] of string[Length(CNewColor)] =
(CNewColor, CNewBlackWhite, CNewMonochrome);
begin
GetPalette := @P[AppPalette];
end;
@ENDIF
@ENDIF (ifoption help)
@SNIPPETS LIKE MTD_*
@IF!SNIPPET MTD_HAND
procedure %_APPTYPE%.HandleEvent;
begin
@IFOPTION TP6
TApplication.HandleEvent(Event);
@ELSE
inherited HandleEvent(Event);
@ENDIF
if Event.What and evMessage <> 0 then
begin
case Event.Command of
@ASSIGN __SECTION 'CALLING'
@FORCALLEDITEMS
@IFEQUAL %_APPITEMTYPE% 'DLG'
%_PADR(_APPITEMCOMMAND,25,' ')% : Call%_DLGFUNC(_DLGNUM)%;
@ENDIF
@IFEQUAL %_APPITEMTYPE% 'MTD'
@NOCR %_PADR(_APPITEMCOMMAND,25,' ')% :
@SNIPPET %_APPITEMFILE%
@ENDIF
@ENDFOR
@ASSIGN __SECTION 'MAIN'
else Exit;
end;
ClearEvent(Event);
end;
end;
@ENDIF
@SNIPPETS LIKE USR_*
{$I %_SUBSTR(_OUTFILE,1,6)%_K.INC}
\ Dialog includes
@FORALLDIALOGS
{$I %__DLGFILE[_DLGNUM]%}
@ENDFOR
@IFOPTION DLG_IN_RSC
{$I %_SUBSTR(_OUTFILE,1,6)%_R.INC}
@ENDIF
@PUSHFILE 5
end;
@POPFILE
@FORCALLEDDIALOGS
@IFSNIPPET %_CALLINGSNIPPET%
@SNIPPET %_CALLINGSNIPPET%
@ELSE
procedure %_APPTYPE%.Call%_DLGFUNC(_DLGNUM)%;
var Result : Word;
@IF!EQUAL %_DLGDATAFLAG(_DLGNUM)% 0
D : T%_DLGFUNC(_DLGNUM)%Data;
@ENDIF
begin
@IFEQUAL %_DLGDATAFLAG(_DLGNUM)% 0
Result:=%_DLGFUNC(_DLGNUM)%;
@ELSE
Result:=%_DLGFUNC(_DLGNUM)%(D,False);
@ENDIF
end;
@ENDIF
@ENDFOR
@FILE 5
@IFMENUBAR
@IFOPTION MENU_IN_RSC
{$I %__MENUFILE%}
@ENDIF (ifoption)
@ENDIF (ifmenubar)
@IFSTATUS
@IFOPTION STATUS_IN_RSC
{$I %__STATUSFILE%}
@ENDIF (ifoption)
@ENDIF (ifmenubar)
@IFOPTION DLG_IN_RSC
@FORALLDIALOGS
@IFEQUAL %__DLGTYPE[_DLGNUM]% 'TDialog'
{$I %__DLGFILE[_DLGNUM]%}
@ENDIF
@ENDFOR
{$I %_SUBSTR(_OUTFILE,1,6)%_R.INC}
@ENDIF
begin
Writeln('Running resource maker...');
RegisterType(RStrListMaker);
RegisterType(RMenuBar);
RegisterType(RHintStatusLine);
@IFOPTION DLG_IN_RSC
RegisterDialogs;
RegisterSupply3;
RegisterEditors;
RegisterViews;
@ENDIF
MenuBar:=nil;
StatusLine:=nil;
ResFile.Init(New(PBufStream,Init('%_SUBSTR(_OUTFILE,1,6)%_R.RSC',stCreate,1024)));
@IF!EQUAL %__HINTCOUNTER% 0
S.Init(%__HINTCOUNTER%*AverageHintSize,%__HINTCOUNTER%);
DefineHints(S);
@ENDIF
@IFMENUBAR
@IFOPTION MENU_IN_RSC
DefineMenuBar;
ResFile.Put(MenuBar,'MENUBAR');
@ENDIF (ifoption)
@ENDIF (ifmenubar)
@IFSTATUS
@IFOPTION STATUS_IN_RSC
DefineStatusLine;
ResFile.Put(StatusLine,'STATUSLINE');
@ENDIF (ifoption)
@ENDIF (ifstatus)
@IF!EQUAL %__HINTCOUNTER% 0
ResFile.Put(@S,'HINTS');
S.Done;
@ENDIF
@IFOPTION DLG_IN_RSC
@FORALLDIALOGS
@IFEQUAL %__DLGTYPE[_DLGNUM]% 'TDialog'
Define%_DLGFUNC(_DLGNUM)%;
@ENDIF
@ENDFOR
@ENDIF
@IFOPTION STR_IN_RSC
ResFile.Put(MakeStringList('%_SUBSTR(_OUTFILE,1,6)%_T.TXT'),'TEXTS');
@ENDIF
if MenuBar<>nil then Dispose(MenuBar,Done);
if StatusLine<>nil then Dispose(StatusLine,Done);
if ResFile.Stream^.Status<>stOk then Writeln('Error #',ResFile.Stream^.Status,' while creating resource file.');
ResFile.Done;
Writeln('Resource done.');
end.
\ Close resource maker program file
@CLOSEFILE 5
@FILE 2
procedure InitResource;
var D : DirStr;
N : NameStr;
E : ExtStr;
begin
FSplit(ParamStr(0),D,N,E);
RegisterType(RHintStatusLine);
RegisterType(RMenuBar);
RegisterType(RStringList);
@IFOPTION DLG_IN_RSC
RegisterDialogs;
RegisterSupply3;
RegisterEditors;
RegisterViews;
@ENDIF
@IFOPTION HELP
RegisterHelpFile;
@ENDIF
ResFile.Init(New(PBufStream,Init(D+'%_SUBSTR(_OUTFILE,1,6)%_R.RSC',stOpenRead,1024)));
if ResFile.Stream^.Status<>stOk then
begin
Writeln('Error loading resource file...');
Halt(1);
end;
@IFOPTION STR_IN_RSC
RscStringList:=PStringList(ResFile.Get('TEXTS'));
@ENDIF
end;
var AppInstance : %_APPTYPE%;
begin
InitResource;
AppInstance.Init;
AppInstance.AdditionalInit;
AppInstance.Run;
AppInstance.Done;
ResFile.Done;
end.
{ ************ Generated by TVGen 3.0 ************** }
\ Close main program file
@CLOSEFILE 2
@FILE 3
implementation
end.
{ ************ Generated by TVGen 3.0 ************** }
@DEFINEFILE 3 %_SUBSTR(_OUTFILE,1,6)%_H.PAS
@FILE 3
unit %_SUBSTR(_OUTFILE,1,6)%_H;
interface
const
@HELPCONSTANTS %_PADR([NAME],60,' ')% = [VALUE];
implementation
end.
{ ************ Generated by TVGen 3.0 ************** }
\ Close Help Constants Unit file and open file for Command Constants
@DEFINEFILE 3 %_SUBSTR(_OUTFILE,1,6)%_C.PAS
@FILE 3
unit %_SUBSTR(_OUTFILE,1,6)%_C;
interface
const
@CMDCONSTANTS %_PADR([NAME],50,' ')% = [VALUE];
implementation
end.
{ ************ Generated by TVGen 3.0 ************** }
\ Close Command Constants Unit file
@CLOSEFILE 3
\ Close help text file
@IFOPTION HELP
@CLOSEFILE 4
@ENDIF
@IFOPTION STR_IN_RSC
@DEFINEFILE 3 %_SUBSTR(_OUTFILE,1,6)%_T.TXT
@FILE 3
@RESOURCESTRINGS
@CLOSEFILE 3
@ENDIF
\ Create batch file
@DEFINEFILE 3 %_OUTFILE%.BAT
@FILE 3
TPC /M %_SUBSTR(_OUTFILE,1,6)%_R
%_SUBSTR(_OUTFILE,1,6)%_R
TPC /M %_OUTFILE%
@IFOPTION HELP
TVHC %_OUTFILE%.TXT %_OUTFILE%.HLP %_SUBSTR(_OUTFILE,1,6)%_X.PAS
@ENDIF
@IFOPTION RUN_FROM_BAT
pause
%_OUTFILE%.EXE
@ENDIF
@CLOSEFILE 3
@IFOPTION DLG_IN_RSC
@CLOSEFILE 6
@ENDIF