home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
pascal
/
psppd100.zip
/
TESTEXE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-09-16
|
2KB
|
73 lines
{
╔══════════════════╗
║ Test PPDInEXE ║
║ Option ║
║ Rev. 1.00 ║
╚══════════════════╝
}
{$F-} {$O-} {$A+} {$G-}
{$V-} {$B-} {$X-} {$N+} {$E+}
{$I FINAL.PAS}
{$IFDEF FINAL}
{$I-} {$R-}
{$D-} {$L-} {$S-}
{$ENDIF}
{$M 8192,100000,100000}
Program TestPPDatabaseInEXEOption;
Uses DBASE;
Const
CheckThisOption = 22; {Where In The String Our Option(s) Are}
Procedure Error(ErrNum:Word);
Begin
If ErrNum=0 Then Exit; {No Error}
WriteLn('Database Failure, Error Report: ',DatabaseErrorMsg(ErrNum),'.');
Halt;
End;
Var
DB:DBaseFile; {Our Database (Object)}
St:String; {A Data Structure to Hold Options}
A :Word; {Error Check}
C :Char; {Data Storage}
Begin
WriteLn;
WriteLn;
{The following puts the string in the EXE file for our usage.}
St:='Options Will Be Here * Now PPD-EXE Header>>'#43#0#0#0+Chr(InEXEFlag)
{ ^Byte 0 (Data) (Length of Data) Word ^^^^^ ^InEXE Marker}
{ Remember to Store Words Reversed (Lo Hi) }
+ Chr(CurVerHi)+Chr(CurVerLo)+'PPDATABASEEXE';
{ ^ Version Number ^ 18 Byte ID Code, Use Only Once in File }
DB.Init; {Must be called}
A:=DB.OpenDatabase('TESTEXE.EXE',0,0); {Open our file}
If A<>0 Then Error(A);
C:='-'; {The new data}
A:=DB.ModEXE(CheckThisOption-1,Addr(C),1); {Change File}
{ ^^ String Starts At 1, File At 0}
Error(DB.CloseDatabase);
If St[CheckThisOption]='*' Then
WriteLn('First Time EXE File Has Been Run.')
Else
WriteLn('Not The First Time EXE File Has Been Run.');
End.