home *** CD-ROM | disk | FTP | other *** search
-
- program CreateFloppyCover;
- {$V-}
- type
- Prt_Str = string[3];
- Prt_Byte = byte;
-
- Printer_Codes = record
- Pr_Type : String[17];
- PR_Codes : array [1..4] of Prt_Str;
- end;
- const
-
- Max_dir = 40; { Max number of directory entries }
- { it can be upped }
- MaxWin = 2; {Maximum windows open at a time}
- Max_Table_entries = 700;
- Max_Arc_Table_entries= 700;
- DirStringLength = 55; { The length of the Directory String }
- DirStringLengthMore = 69; { The length of the Dir String + file name }
- { These values are above DOS maxinum. }
-
- {------------------------------------------------------------------}
- { The following codes are filled with data in the install option }
-
- Condenced_Print : Prt_Str = ' ';
- Top_Of_Form : Prt_Str = ' ';
- Reset_Printer : Prt_Str = ' ';
- Line_Spacing : Prt_Str = ' ';
- ConstText : Prt_Byte = 4;
- ConstBackground : Prt_Byte = 0;
- WindoText : Prt_Byte = 14;
- WindoBackground : Prt_Byte = 1;
-
- {------------------------------------------------------------------}
- { if you know of the different printer constants please forward then }
- { to the author and he will send you a new version of the program }
- { Please send a xerox of the manual page of printer codes }
- { Thank you very much }
- { Printer Constants }
- { the number in the array must be changed if you add a printer }
- Printer_Codes_Const : array [1..3] of Printer_Codes =
- ((Pr_Type : 'EPSON';
- Pr_Codes : (#$1B#$0F#$00,#$0C#$00#$00,#$1B#$40#$00,#$1B#$30#$00)),
- (Pr_Type : 'OKIDATA';
- Pr_Codes : (#$1D#$00#$00,#$0C#$00#$00,#$18#$00#$00,#$1B#$38#$00)),
- (Pr_Type : 'OKIDATA PLUG/PLAY';
- Pr_Codes : (#$0F#$00#$00,#$0C#$00#$00,#$18#$1B#$32,#$1B#$30#$00)));
-
- Max_Print_Lines = 39; { Maximum number of print rows }
- { Counting heading and data }
-
- type
-
- String20 = string[20];
- String41 = string[41];
- Str80 = string[80];
- String82 = string[82];
- String42 = string[42];
- AnyStr = string[255];
- CharSet = set of Char;
-
- SortArray = array[1..Max_Table_Entries] of String41;
-
- RegRec = { The data to pass to DOS }
- record
- AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags : Integer;
- end;
- HalfRegtype = record Al,Ah,Bl,Bh,Cl,Ch,Dl,Dh:byte end;
-
- var
- { File and Drive areas }
- FileMO, { File creation Month }
- FileDA, { File creation Day }
- FileYR, { File creation Year }
- FileHR, { File creation Hour 24 hour clock }
- FileMN, { File creation Minute 60 min clock }
- ReadDrive, { This is the drive I will read }
- DefaultDrive, { This is the current default drive }
- WriteDrive : String[2]; { Drives used in reading and writing }
- DriveWanted : String[1]; { What drive do you want to read }
- VolumeIDWanted : Char; { Create Volume ID }
- FileSizeString : string[6]; { This is the file size string format }
- SortList : SortArray; { This is the array being sorted }
- ArcList : SortArray; { This is the array of files in the arc }
- NumericDriveHold, { Used in the free space on floppy drive }
- status, { Not checked on Val command }
- BegSub, { The beginning subscript }
- E, E_use, { Working integers }
- HoldDirNum, { The file Dir in integer format }
- SRN, { SortRecordNumber }
- ArcSrn, { Used in Arc file Manipulation }
- SRNHold, { " " " " " " " }
- SRN2ndHalf, { " " " " " " " }
- FileSiLow, { Low order byte file size }
- FileSiHigh : integer; { High order byte file size }
- RealWork, { Used in the calculation }
- TotalAreaOnDisk, { Used in calculation of space on disk }
- FreeAreaOnDisk : real; { of free area on the floppy }
- HoldDir, { Used to compare current dir }
- HoldDirSave, { Used to restore HoldDir }
- HoldDirComp, { with previous directories }
- FileDir : string[2]; { Directory Tree Subscript }
- FileNme : string[14]; { File Name }
- FileDateDos : integer; { File Creation Date Dos Format }
- FileHourDos : integer; { File Creation Time Dos Format }
- FileSiz : real; { File size }
- FileAttributes : string[3]; { Codes for System, hidden, dir etc. }
- FilVar : text; { Is it Disk: or LST: }
- MaxEntries, { Have I reached Max in the table }
- MaxArcEntries, { Have I reached Max in the table }
- GoodFileName, { This is a disk file }
- FirstTimeDrive, { First time in the Drive Routine }
- FirstTime, { First time in this routine }
- DriveOK, { Its OK to do this drive }
- NotDir : Boolean; { This is not a directory rec I read }
- Buffer, { Used in file name manipulation }
- Buffer1, { " }
- Buffer2 : String [DirStringLength];
- { " }
- DirTable : Array [ 1..Max_dir ] of string[DirSTringLength];
- { Dirs Found }
- FileHidden, { The file is a hidden file }
- FileRead, { The file is a read only file }
- FileSystem : Boolean; { The file is a system file }
- HoldDirName : String41; { used in arc handleing }
- HoldDirNameSave : String41; { used in lbr handleing }
- PrevLine : AnyStr; { used in title processing }
- ScreenAttr : Byte;
-
- { Dos Areas }
-
- Regs : RegRec; { Dos Registers }
- HalfRegs : halfregtype absolute regs;
- NamR : String20; { The file name from the DTA }
- DTA : array [ 1..43 ] of Byte; { Back from DOS }
- Mask : array [ 1..DirStringLength ] of Char;
- { What do we read DOS calls }
- Error : integer; { Error code from Dos - Not used in }
- { coding, this was a testing field }
- VolumeIDWrite : string[16]; { The disk Volume-id }
- VolumeIDRead : string[16];
- Printer_Codes_Wk : Prt_Str;
-
-
- { Printer Areas }
-
- ColumnWork, { Work area for print columns }
- Column : string82; { The slip sheet line for big dirs }
- Column3 : string[88]; { The slip sheet line for big dirs }
- Column1, { The slip sheet line for small dirs }
- Column2 : string42; { The second column for the slip sheet }
- ExternalMessage : string[50]; { What is printed on the slip sheet }
- PrintLines, { Number of lines printed not }
- { counting dashes }
- SlipSheetLines, { Number of lines on a slip sheet }
- PrintPages, { Number of Slip sheets on a page }
- PrintColumn : integer; { Number of column being printed }
- blankline, { The side lines }
- Dashes : string[88]; { What prints at top of form }
- FoldLine : string[88]; { The fold line on a long slip sheet }
- PrintOption : Boolean; { Do we create the print report }
-
- { Misc Areas }
-
- timestr : string[11]; { like it says }
- datestr : string[15]; { " }
- Option : Char;
- DirectoryChanged : string[1]; { Did we just change a directory }
- I, { used for loops }
- A, B, C, { " }
- NumberRecs, { How many records on disk }
- FileYear, { File Year actual not just since 1980 }
- FileWork, { Work area }
- FileWork2 : integer; { Work area }
- FileWork3 : real; { Work area for file size }
- NewDir, { Work areas in directory name }
- NewDirWork : string[DirStringLengthMore]; { and file name manipulation }
- FileOption, { Do you want a dir file instead of }
- { a slip sheet }
- DirOption, { Do you only want to use 1 directory }
- DirOptionContinued : Boolean; { Is this the second or more dir }
- { when you are processing by dirs }
-
- (*****************************************************************************
- This is the beginning of the program code.
- *****************************************************************************)
- (* Beep sounds the terminal bell or beeper *)
-
- procedure Beep;
- begin
- Write(^G);
- end;
-
- {$IKEYIN.INC}
- {$IWindo.Inc}
- {$ISCOLOR.200}
- {$IDISKARC.INC}
- {$IDISKLBR.INC}
- procedure Install_System;
- type
- FileName = string[80];
- Message = string[80];
-
- {This function returns the number of bytes occupied by the image of this .COM
- file in memory. Known to work for Turbo programs compiled under the regular,
- 8087, and BCD versions of the Turbo 2.00B, 3.00B, and 3.01A compilers for DOS.}
-
- function CodeSize: Integer;
- var
- i: Byte;
- begin
- i := 11;
- while {Turbo version is marked on the left:}
- {3.0:} not ((Mem [DSeg-2:i+3] <> $00E9) and (MemW[DSeg-2:i+4] = $0000)) and
- {2.0:} not ((MemW[DSeg-2:i+0] = $00E9) and (MemW[DSeg-2:i+2] = $E800)) do
- i := i + 1;
- CodeSize := ((((DSeg - 2) - CSeg) shl 4) + i + 6) - $100
- end {CodeSize};
-
- procedure Clone (fn: FileName);
-
- procedure Abort(msg: Message);
- begin
- writeln(msg);
- Halt
- end {Abort};
-
- var
- handle, length: Integer;
- regPack: record
- case Integer of
- 1: (AX, BX, CX, DX, BP, SI, DI, DS, ES, Flags: Integer);
- 2: (AL, AH, BL, BH, CL, CH, DL, DH: Byte)
- end;
- writeError: Boolean;
- begin
- with regPack do
- begin
- fn := fn + #0; {Convert "fn" to an ASCIIZ string}
- length := CodeSize; {Length of code image in memory}
- AH := $3C; {Create a file}
- DS := Seg(fn[1]); {Segment of ASCIIZ file name}
- DX := Ofs(fn[1]); {Offset of ASCIIZ file name}
- CX := 0; {Default attributes}
- MsDos(regPack); {Create the clone file}
- if Odd(Flags) then {Check if carry bit is set}
- Abort('Unable to create file');
- handle := regPack.AX; {Retrieve handle for opened file}
- AH := $40; {Write to a file}
- BX := handle; {File to write to}
- DS := CSeg; {Segment of code}
- DX := $100; {Beginning address of code}
- CX := length; {Length of code}
- MsDos(regPack); {Write the code to the clone file}
- writeError := Odd(Flags) or (AX <> length);
- if writeError then {Allow the file to be closed, anyway}
- writeln('Unable to write to file');
- AH := $3E; {Close a file}
- BX := handle; {File to close}
- MsDos(regPack); {Close the output file}
- if Odd(Flags) then {Check if carry bit is set}
- Abort('Unable to close file');
- if writeError then Halt {Halt if there was a write error previously}
- end
- end {Clone};
-
- Procedure Get_Codes;
- var
- option : Prt_Str;
- numoption : integer;
- error : integer;
- begin
- for i := 1 to 3 do
- begin
- Write('Enter printer code for the ');
- if i = 1 then write('first')
- else if i = 2 then write('second')
- else write('third');
- write(' command ');
- readln(option);
- if length(option) > 0 then
- begin
- Val(option,numoption,error);
- Printer_Codes_WK[i] := Chr(numoption);
- end;
- end;
- end;
-
- var
- i, max,maxmore,option : integer;
- Ch : char;
- begin
- ScreenAttr := ConstText + (ConstBackground * 16);
- MkWin(20,3,61,10,2,ConstText,ConstBackground);
- Writeln(' Diskover Program Install Section');
- Writeln;
- Writeln(' Now installing the Text and Background');
- Writeln(' Colors');
- Writeln;
- Select_Color(ScreenAttr);
- ConstText := ScreenAttr and $0F; ConstBackground := ScreenAttr shr 4;
- RmWin;
- MkWin(20,3,61,10,2,ConstText,ConstBackground);
- Writeln(' Diskover Program Install Section');
- Writeln;
- Writeln(' Now installing the Window');
- Writeln(' Text and Background Colors');
- Writeln;
- ScreenAttr := WindoText + (WindoBackground * 16);
- Select_Color(ScreenAttr);
- WindoText := ScreenAttr and $0F; WindoBackground := ScreenAttr shr 4;
- RmWin;
- TextColor(ConstText); TextBackground(ConstBackground);
- clrscr;
- { This should be the number of printers installed in the constant table }
- max := 3;
- maxmore := 4; { one more than max }
- { The one above should be one more than max }
- if Condenced_Print <> ' ' then
- begin
- Writeln('The program has been installed for a printer');
- Writeln;
- Write('Do you wish to reinstall it? (Y/N)');
- repeat Read(Kbd,Ch) until Ch in ['Y','N','y','n'];
- if Ch in ['Y','y'] then Condenced_Print := ' ';
- end
- else
- writeln('The program has not been installed for a printer.');
- if Condenced_Print = ' ' then
- begin
- writeln;
- writeln('You must enter the required codes for Condenced Print :');
- writeln(' Top of Form :');
- writeln(' 1/8 th line spacing :');
- writeln(' Reset Printer :');
- writeln;
- writeln('It already has codes for ',max,' printer types.');
- writeln;
- for i := 1 to max do
- writeln('Please enter code ',i,' for ',Printer_Codes_Const[i].Pr_Type);
- writeln;
- write('Enter ',maxmore,' for another printer type Option: ');
- repeat
- readln(Option);
- until Option in [1..maxmore];
- if Option = maxmore then
- begin
- Condenced_Print := #$00#$00#$00;
- Top_Of_Form := #$00#$00#$00;
- Reset_Printer := #$00#$00#$00;
- Line_Spacing := #$00#$00#$00;
- ClrScr;
- Writeln; Writeln;
- Writeln('If the printer does not require three codes enter zero');
- Writeln(' for the extra questions');
- Writeln;
- Writeln('To enter the codes to be sent to the printer');
- Writeln;
- Writeln('Press the numeric ASCII codes for each of the options');
- Writeln(' i.e. ESC should be typed as 27');
- Writeln(' Use the decimal number for entry');
- Writeln('The program will ask for the necessary codes - Press return when finished');
- Writeln;
- Writeln(' Enter codes for Condenced Print <17 char per inch>');
- Get_Codes;
- Condenced_Print := Printer_Codes_WK;
- Writeln(' Enter codes for Top of Form');
- Get_Codes;
- Top_Of_Form := Printer_Codes_WK;
- Writeln(' Enter Codes for Reset Printer <power up state>');
- Get_Codes;
- Reset_Printer := Printer_Codes_WK;
- Writeln(' Enter Codes for 1/8th inch line spacing <8 lines inch>');
- Get_Codes;
- Line_Spacing := Printer_Codes_WK;
- end
- else
- begin
- Condenced_Print := Printer_Codes_Const[Option].Pr_Codes[1];
- Top_Of_Form := Printer_Codes_Const[Option].Pr_Codes[2];
- Reset_Printer := Printer_Codes_Const[Option].Pr_Codes[3];
- Line_Spacing := Printer_Codes_Const[Option].Pr_Codes[4];
- end;
- end;
- Clone('DISKOVER.COM');
- writeln;
- writeln('If you now run "', 'DISKOVER.COM',
- '," you will have the new printer and color options.');
- end; {Install}
-
- {----------------------------------------------------------------------------}
- { This routine get the DOS date and makes it look good }
-
- procedure date; { What is todays date }
- const
- montharr : array [1..12] of string[3] =
- ('Jan','Feb','Mar','Apr','May',
- 'Jun','Jul','Aug','Sep','Oct','Nov','Dec');
-
- var
- regs:regrec;
- month, day:string[2];
- year:string[4];
- dx, cx, result, tmpmonth:integer;
-
- begin
- with regs do
- begin
- ax:= $2a shl 8;
- end;
- msdos (regs);
- with regs do
- begin
- str(cx:4, year);
- str(dx shr 8:2, month);
- str(dx mod 256:2, day);
- end;
- if month[1] = ' ' then month[1] := '0';
- val (month, tmpmonth, result);
- datestr:= day + '-' + montharr[tmpmonth] + '-' + year
- end; { procedure date }
-
-
- { This routine gets the DOS time and makes it look good }
-
- procedure time; { What is the current time }
- var { Not on your watch! in the computer }
- regs:regrec;
- ah, al, ch, cl, dh:byte;
- hour, min, sec, ampm:string[2];
- tmptime, result:integer;
-
- begin
- ah := $2c;
- with regs do
- begin
- ax := ah shl 8 + al;
- end;
- intr($21,regs);
- with regs do
- begin
- str(cx shr 8:2, hour);
- str(cx mod 256:2, min);
- str(dx shr 8:2, sec);
- end;
- if (hour > '11') then
- ampm := 'pm'
- else
- ampm := 'am';
- if (hour < ' 1') then
- begin
- ampm := 'am';
- hour := '12';
- end;
- if (hour > '12') then
- begin
- val (hour, tmptime, result);
- tmptime:= tmptime - 12;
- str (tmptime:2, hour);
- end;
- if (min[1] = ' ') then
- min[1]:= '0';
- if (sec[1] = ' ') then
- sec[1]:= '0';
- timestr := hour + ':' + min + ':' + sec + ' ' + ampm;
- end; { procedure time }
-
-
- { This routine sets up the Data Transfer Area (DTA) for DOS }
-
- procedure SetUpDTA;
- begin
- Regs.AX := $1A00; { Function used to set the DTA }
- Regs.DS := Seg(DTA); { store the parameter segment in DS }
- Regs.DX := Ofs(DTA); { " " " offset in DX }
- MSDos(Regs); { Set DTA location }
- Error := Regs.AX and $FF;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine reads the volume id in a directory - Version 1.1 }
- {--- Written by Karson W Morrison Caleb Computing Center ---}
-
- procedure ReadVolume;
- var i,a : integer;
- z : char;
- dotfound : boolean;
- begin
- VolumeIDWrite := DriveWanted + ':\????????.???' + chr(0);
- for i := 1 to length(VolumeIDWrite) do
- Mask[i] := VolumeIDWrite[i];
- VolumeIDRead := ' ';
- Regs.AX := $4E00; { Get first directory entry }
- Regs.DS := Seg(Mask); { Point to the file Mask }
- Regs.DX := Ofs(Mask);
- Regs.CX := $0008; { Store the option for Volume label }
- MSDos(Regs); { Execute MSDos call }
- Error := Regs.AX and $FF; { Get Error return }
- a := 0;
- dotfound := false;
- if error = 0 then
- for i := 1 to 12 do
- begin
- z := Chr(Mem[Seg(DTA):Ofs(DTA)+29+i]);
- if (z = '.') and (i <> 9) then
- begin
- dotfound := true;
- z := ' ';
- repeat
- a := a + 1;
- VolumeIDRead[a] := z;
- until a = 8;
- end
- else
- begin
- if dotfound then
- begin
- a := a + 1;
- VolumeIDRead[a] := z;
- end
- else
- if i <> 9 then
- begin
- a := a + 1;
- VolumeIDRead[a] := z;
- end;
- end;
- end;
- for i := 1 to 12 do
- if VolumeIDRead[i] = Chr(0) then
- VolumeIDRead[i] := ' ';
- end;
-
- {----------------------------------------------------------------------------}
- { This routine writes the volume id in a directory }
- {--- Written by Karson W Morrison Caleb Computing Center ---}
- {--- Note an edit is done in the input phase to reject ---}
- {--- invalid characters for a vol-id ---}
- procedure WriteVolume;
- var i,a : integer;
- begin
- VolumeIDWrite := DriveWanted + ':' + VolumeIDWrite + chr(0);
- a := 0;
- for i := 1 to length(VolumeIDWrite) do
- if i <> 11 then
- begin
- a := a + 1;
- Mask[a] := VolumeIDWrite[i];
- end
- else
- begin
- a := a + 1;
- Mask[a] := '.';
- a := a + 1;
- Mask[a] := VolumeIDWrite[i];
- end;
- Regs.AX := $3C00; { Create a file }
- Regs.DS := Seg(Mask); { Point to the file Mask }
- Regs.DX := Ofs(Mask);
- Regs.CX := $0008; { Store the option for Volume label }
- MSDos(Regs); { Execute MSDos call }
- Regs.BX := Regs.AX; { Put file handle in BX }
- Regs.AX := $3E00; { Close the file }
- MSDos(Regs); { Execute MSDos call }
- Error := Regs.AX and $FF; { Get Error return }
- end;
-
-
- { This routine reads the first record in a directory }
-
- procedure ReadFirst;
- begin
- Regs.AX := $4E00; { Get first directory entry }
- Regs.DS := Seg(Mask); { Point to the file Mask }
- Regs.DX := Ofs(Mask);
- Regs.CX := 23; { Store the option }
- MSDos(Regs); { Execute MSDos call }
- Error := Regs.Flags and $01;
- end;
-
-
- { This routine reads all following records in a directory }
-
- procedure ReadNext;
- begin
- Error := 0;
- Regs.AX := $4F00; { Function used to get the next }
- { directory entry }
- Regs.CX := 23; { Set the file option }
- MSDos(Regs); { Call MSDos }
- Error := Regs.AX or (Regs.Flags and $01) and $FF; { get the Error return }
- end;
-
-
- { This routine gets the name string from the directory }
- { VIA the DTA. }
-
- procedure SetUpNamR; { Get the file name from the directory }
- begin
- repeat
- NamR[I] := Chr(Mem[Seg(DTA):Ofs(DTA)+29+I]);
- I := I + 1;
- until not (NamR[I-1] in [' '..#$7F]) or (I>20); { Note: The second item }
- { being compared as in [' '..#$7F] is }
- { the 7Fh char DEL }
-
- NamR[0] := Chr(I-1); { set string length because assigning }
- { by element does not set length }
- end;
-
-
- { This routine gets the new directory name from the table }
- { that was built as we were reading the parent directory }
- { it is for this reason that the children directories are }
- { not built on the floppy imediately following the parent }
- { directories. All parent directories are saved followed }
- { by all level 2 subdirectories, followed by the third level }
- { Etc. }
- {----------------------------------------------------------------------------}
-
- procedure Set_Up_Dir_Chg; { Get a new directory from the table }
- begin
- E_Use := E_Use + 1;
- Buffer := DirTable[E_use] + '\????????.???' + Chr( 0);
- Buffer1 := DirTable[E_use];
- GoToXY(25,18); ClrEol;
- Write(Buffer1);
- NewDir := DirTable[E_use] + Chr(0);
- NewDir[1] := WriteDrive[1]; { overlay the read drive with the write }
- NewDirWork := NewDir; { this will be used to set up new directories }
- { on a floppy if it changes floppies. }
- if length(Buffer1) = 1 then Buffer1 := '';
- for I := 1 to length(Buffer) do
- Mask[I] := Buffer[I];
- DirectoryChanged := '1';
- end;
-
- {----------------------------------------------------------------------------}
- { This routine gets the Date from the DTA for the file }
-
- procedure FindDate; { Translate the Date from the Disk to }
- begin { Something readable }
- FileMO := ' '; { yyyyyyymmmmddddd in bits}
- FileDA := ' ';
- FileDateDos := MemW[Seg(DTA):Ofs(DTA)+24];
- FileYear := FileDateDos shr 9; { drop off the last 9 positions }
- Str((FileYear + 80),FileYR); { years are added to base year of 1980 }
- FileWork := FileDateDos shl 7; { drop off the first 7 positions }
- Str((FileWork shr 12),FileMO); { now move it back to the right }
- FileWork := FileDateDos shl 11; { drop off the left 11 positions }
- Str((FileWork shr 11),FileDA); { now move back to the right }
- FileMO[0] := Chr(2);
- FileDA[0] := Chr(2);
- if FileDA[2] = ' ' then
- begin
- FileDA[2] := FileDA[1];
- FileDA[1] := '0';
- end;
- if FileMO[2] = ' ' then
- begin
- FileMO[2] := FileMO[1];
- FileMO[1] := '0';
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine gets the time from the DTA for the file }
-
- procedure FindTime; { Get the time and put it in a format that }
- begin { we can use. The Dos Format in bits is }
- FileHR := ' '; { hhhhhmmmmmmsssss }
- FileMN := ' ';
- FileHourDos := MemW[Seg(DTA):Ofs(DTA)+22];
- Str((FileHourDos shr 11),FileHR); { Shift it around so the minutes and }
- FileWork := FileHourDos shl 5; { seconds disappear }
- Str((FileWork shr 10),FileMN);
- FileHR[0] := Chr(2);
- FileMN[0] := Chr(2);
- if FileHR[2] = ' ' then
- begin
- FileHR[2] := FileHR[1];
- FileHR[1] := '0';
- end;
- if FileMN[2] = ' ' then
- begin
- FileMN[2] := FileMN[1];
- FileMN[1] := '0';
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine gets the file size from the DTA }
-
- procedure FindSize; { Get the file size and format it so we can }
- begin { use it }
- FileWork := MemW[Seg(DTA):Ofs(DTA)+26]; { Get from DTA, Low byte of size }
- FileSiLow := FileWork; { Save Low byte size }
- FileWork2 := FileWork shr 15; { Is the High bit on }
- FileWork3 := FileWork2 * 32768.0; { yes! Save the size }
- FileWork2 := FileWork shl 1; { Get rid of high bit }
- FileWork := FileWork2 shr 1; { Now back to where we were }
- FileWork3 := FileWork3 + FileWork; { Lets add them together }
- FileWork := MemW[Seg(DTA):Ofs(DTA)+28]; { Get from DTA, High byte }
- FileSiHigh := FileWork; { Save High byte size }
- FileSiz := FileWork3 + (FileWork * 65536.0); { Make size total }
- end;
-
- {----------------------------------------------------------------------------}
- { This routine looks at the DTA to find the byte that }
- { carries the attribute bytes with the indicator that }
- { shows what is a directory. This routine also get the }
- { System, Hidden and read only attribute }
-
- procedure PrintDTA;
- var
- FileAttr : Byte;
- begin
- FileHidden := false;
- FileRead := false;
- FileSystem := false;
- GoodFileName := true;
- FileAttr := Byte(Mem[Seg(DTA):Ofs(DTA)+21]);
- if FileAttr > 31 then { File Not Archived }
- begin
- FileAttr := FileAttr - 32;
- end;
- if FileAttr > 15 then { This is a directory entry }
- begin { Let's do it to it }
- GoodFileName := false;
- E := E + 1; { Save the name in the table }
- Buffer2 := Buffer1;
- A := Length(Buffer2) + 1;
- B := Length(NamR);
- C := 1;
- Buffer2[A] := '\';
- repeat
- A := A + 1;
- Buffer2[A] := NamR[C];
- C := C + 1;
- until C > B;
- if A > 49 then { Dos has a maxinum of 63, this is to allow file name }
- begin
- Writeln;
- ClrEol;
- Writeln('This program has encountered a directory string greater than');
- ClrEol;
- Writeln('DOS allowed. Dos only allows a concatinated string length of');
- ClrEol;
- Writeln('63 positions.');
- ClrEol;
- Halt;
- end;
- Buffer2[0] := Chr(A - 1);
- DirTable[ E ] := Buffer2;
- end;
- if FileAttr > 7 then { Volume Label }
- FileAttr := FileAttr - 8;
- if FileAttr > 3 then { System File }
- begin
- FileAttr := FileAttr - 4;
- FileSystem := true;
- end;
- if FileAttr > 1 then { Hidden File }
- begin
- FileAttr := FileAttr - 2;
- FileHidden := true;
- end;
- if FileAttr > 0 then { Read Only }
- begin
- FileAttr := FileAttr - 1;
- FileRead := true;
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine gets the current default drive }
- { If the option is to create the print file on }
- { disk then the input drive for the program to read }
- { cannot be the default drive, because the file DIR.DIR }
- { will be created on the default drive. }
-
- procedure GetCurrentDrive;
- begin
- Regs.AX := $1900;
- MSDos(Regs);
- DefaultDrive := Char(HalfRegs.Al + 65) + ':'; { HalfRegs.Al has $00 for }
- Error := Regs.Flags and $01; { drive A, $01 for B, etc. }
- end;
-
- {----------------------------------------------------------------------------}
- { the following routines were taken from a Borland Package in their database }
- { toolbox, and have been modified by the author }
-
- function ConstStr(C : Char; N : Integer) : Str80;
- var
- S : string[80];
- begin
- if N < 0 then
- N := 0;
- S[0] := Chr(N);
- FillChar(S[1],N,C);
- ConstStr := S;
- end;
-
- procedure InputStr(var S : AnyStr;
- L,X,Y : Integer;
- Term : CharSet;
- var TC : Char;
- Code : Char );
- const
- UnderScore = '_';
- var
- P : Integer;
- Ch : Char;
- Snd : Char;
- badvolid : boolean;
- begin
- GotoXY(X,Y); Write(S,ConstStr(UnderScore,L - Length(S)));
- P := 0;
- badvolid := false;
- repeat
- GotoXY(X + P,Y); Read(Kbd,Ch);
- case Ch of
- #27 : begin
- Read(Kbd,Snd);
- case Snd of
- #61 : begin
- S := PrevLine;
- P := Length(S);
- GotoXY(X,Y); Write(S,ConstStr(UnderScore,L - Length(S)));
- end;
- 'K' : if P > 0 then P := P -1
- else Beep;
- 'M' : if P < length(S) then P := P + 1
- else Beep;
- 'G' : P := 0;
- 'O' : P := length(S);
- 'S' : if P < length(S) then
- begin
- Delete(S,P+1,1);
- Write(Copy(S,P+1,L),UnderScore);
- end
- else Beep;
- else Beep;
- end; { of case }
- end;
- #32..#126 : begin
- if Code = 'V' then { Volume-ID }
- begin
- if Ch in [#42..#44,#46,#58..#63,#91,#93..#94,
- #124,#126] { not valid codes }
- then badvolid := true;
- end;
- if (P < L) and (not badvolid) then
- begin
- if Length(S) = L then
- Delete(S,L,1);
- P := P + 1;
- Insert(Ch,S,P);
- Write(Copy(S,P,L));
- end
- else Beep;
- badvolid := false;
- end;
- ^S : if P > 0 then
- P := P - 1
- else Beep;
- ^D : if P < Length(S) then
- P := P + 1
- else Beep;
- ^A : P := 0;
- ^F : P := Length(S);
- ^G : if P < Length(S) then
- begin
- Delete(S,P + 1,1);
- Write(Copy(S,P + 1,L),UnderScore);
- end;
- ^H,#127 : if P > 0 then
- begin
- Delete(S,P,1);
- Write(^H,Copy(S,P,L),UnderScore);
- P := P - 1;
- end
- else Beep;
- ^Y : begin
- Write(ConstStr(UnderScore,Length(S) - P));
- Delete(S,P + 1,L);
- end;
- else
- if not (Ch in Term) then Beep;
- end; {of case}
- until Ch in Term;
- P := Length(S);
- PrevLine := S;
- GotoXY(X + P,Y);
- Write('' :L - P);
- TC := Ch;
- end;
- { End of the routines modified from the Borland's package }
- {----------------------------------------------------------------------------}
- { This routine prints a slip sheet that will go into the diskette }
- { envelope. The routine uses the lo and hi }
- { subscripts and prints all file names in between. }
-
- Procedure PrintLabel(PrintList : SortArray; lo, hi : integer);
- const
- Term : CharSet = [^M,^Z];
- var
- SRNStop : integer;
- SRNHold : integer;
- SRN2ndHalf : integer;
- I : integer;
- TC : char;
- begin
- if PrintLines = 0 then
- begin
- GoToXY(5,22); Write('Type "F3" to return previous label');
- GoToXY(1,19); Writeln('What external label do you want on the Cover?');
- ExternalMessage := '';
- repeat
- InputStr(ExternalMessage,50,1,20,Term,TC,' ');
- until TC in Term;
- for I := Length(ExternalMessage) + 1 to 50 do
- ExternalMessage[I] := ' ';
- ExternalMessage[0] := chr(50);
- Writeln(FilVar,dashes);
- Writeln(FilVar,blankline);
- Writeln(FilVar,'| ',ExternalMessage,' Free: ',FreeAreaOnDisk:7:0,' ',DateStr,' |');
- Column2 := ' ';
- Write(FilVar,'| Volume-ID: ',VolumeIDRead,' ');
- Writeln(FilVar,' ',TimeStr,' |');
- PrintLines := 4;
- SlipSheetLines := 4;
- PrintColumn := 1;
- end;
- if HoldDir <> '01' then
- begin
- Val(HoldDir,HoldDirNum,status);
- Column1 := ' ';
- HoldDirName := DirTable[HoldDirNum];
- Delete(HoldDirName,1,2); { delete the first 2 character }
- Column1 := HoldDirName; { it's the drive and : }
- HoldDirName := HoldDirName +'\'; { set up for *.ARC processing }
- HoldDirNameSave := HoldDirName; { set up for *.LBR processing }
- Column1[length(Column1)+1] := ' ';
- Column1[length(Column1)+2] := ' ';
- Column1[0] := chr(40);
- Column3 := '| Directory ' + Column1 + ' |';
- Writeln(FilVar,blankline);
- Writeln(FilVar,Column3);
- Writeln(FilVar,blankline);
- PrintLines := PrintLines + 3;
- SlipSheetLines := SlipSheetLines + 3;
- end
- else
- HoldDirName := '';
- SRN2ndHalf := (hi -((hi - lo) div 2) + 1); { 2nd half starts at 1 past }
- if odd((hi + 1) - lo) then { the mid point }
- begin { if the total entries is }
- SRNStop := SRN2ndHalf - 1; { odd then then I need to }
- SRN2ndHalf := SRN2ndHalf - 1; { start 1 higher than the }
- end { mid point }
- else
- begin
- SRNStop := SRN2ndHalf - 2;
- SRN2ndHalf := SRN2ndHalf - 2;
- end;
- for I := lo to SRNStop do { from bottom to mid point }
- begin
- SlipSheetLines := SlipSheetLines + 1;
- if SlipSheetLines > 40 then
- begin
- Writeln(FilVar,FoldLine);
- SlipSheetLines := 2; { its 2 because the its one }
- PrintLines := PrintLines + 1; { higher than has been printed }
- end;
- SRN2ndHalf := SRN2ndHalf + 1;
- Column1 := ' ';
- ColumnWork := PrintList[I];
- Delete(ColumnWork,1,2);
- ColumnWork[0] := chr(length(PrintList[I])-2);
- Column1 := ColumnWork; { remove the chr(0) at end }
- Column1[0] := Chr(40); { Make it a length of 40 }
- Column2 := ' ';
- if SRN2ndHalf <= hi then { If I have already hit the }
- begin { end of the right side }
- ColumnWork := PrintList[SRN2ndHalf]; { don't go any further }
- Delete(ColumnWork,1,2);
- ColumnWork[0] := chr(length(PrintList[SRN2ndHalf])-2);
- Column2 := ColumnWork; { remove the chr(0) at end }
- Column2[0] := Chr(40); { Make it a length of 40 }
- end;
- Writeln(FilVar,'| ',Column1,' ',Column2,' |'); { Write the line }
- PrintLines := PrintLines + 1;
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine prints the header for the ARC files on the cover }
-
- Procedure PrintArcHeader;
- begin
- Column1 := ' ';
- Column1 := ArcName;
- Delete(Column1,1,2); { delete the first 2 character }
- Column1[length(Column1)+1] := ' ';
- Column1[length(Column1)+2] := ' ';
- Column1[0] := chr(40); { it's the drive: }
- Column3 := '| Arc File ' + Column1 + ' |';
- Writeln(FilVar,blankline);
- Writeln(FilVar,Column3);
- PrintLines := PrintLines + 2;
- SlipSheetLines := SlipSheetLines + 2;
- end;
- {----------------------------------------------------------------------------}
- { This routine prints the files that are included in the *.ARC file }
- { The routine scans the sorted files list looking for `.ARC' if I find it }
- { I then procede to print the file, size, and date for all entries in the }
- { ARC file }
-
- Procedure PrintArc(lo, hi : integer);
- var
- SRNStop : integer;
- SRNHold : integer;
- SRN2ndHalf : integer;
- I : integer;
- hdr : heads;
- begin
- MaxArcEntries := False;
- for i := lo to hi do
- begin
- if Pos('.ARC',SortList[i]) <> 0 then
- begin
- ArcName := copy(SortList[i],3,(Pos('.ARC',SortList[i])+2));
- ArcName := ReadDrive + HoldDirName + ArcName;
- OpenArc;
- if arcopen then
- begin
- ArcSrn := 0;
- while readhdr(hdr) do
- begin
- if ArcSrn < Max_Arc_Table_Entries then
- ArcSrn := ArcSrn + 1
- else
- begin
- if MaxArcEntries then
- else
- begin
- GoToXY(1,20);
- Write('The Maximum number of entries have been reached for the Arc Core Table');
- MaxArcEntries := True;
- end;
- end;
- lstfile(hdr);
- fseek(long_to_real(hdr.size));
- end;
- fclose;
- PrintArcHeader;
- HoldDirSave := HoldDir;
- HoldDir := '01';
- PrintLabel(ArcList,1,ArcSrn);
- HoldDir := HoldDirSave;
- end;
- end;
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine prints the cover heading for the *.LBR file }
-
- Procedure PrintLbrHeader;
- begin
- Column1 := ' ';
- Column1 := ArcName;
- Delete(Column1,1,2); { delete the first 2 character }
- Column1[length(Column1)+1] := ' ';
- Column1[length(Column1)+2] := ' ';
- Column1[0] := chr(40); { it's the drive: }
- Column3 := '| Lbr File ' + Column1 + ' |';
- Writeln(FilVar,blankline);
- Writeln(FilVar,Column3);
- PrintLines := PrintLines + 2;
- SlipSheetLines := SlipSheetLines + 2;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine prints the file names in the *.LBR file }
- { it scans the sorted table array for a file with '.LBR' if found }
- { I print the data. See the comments in the DISKLBR.INC file and under the }
- { main comments in this program for *.LBR file differences. }
-
- Procedure PrintLbr(lo, hi : integer);
- var
- SRNStop : integer;
- SRNHold : integer;
- SRN2ndHalf : integer;
- I : integer;
- hdr : heads;
- begin
- for i := lo to hi do
- begin
- MaxArcEntries := False;
- if Pos('.LBR',SortList[i]) <> 0 then
- begin
- HoldDirName := HoldDirNameSave;
- ArcName := copy(SortList[i],3,(Pos('.LBR',SortList[i])+2));
- ArcName := ReadDrive + HoldDirName + ArcName;
- OpenLbr;
- if lbropen then
- begin
- ArcSrn := 0;
- while readlbrhdr do
- begin
- if ArcSrn < Max_Arc_Table_Entries then
- ArcSrn := ArcSrn + 1
- else
- begin
- if MaxArcEntries then
- else
- begin
- GoToXY(1,20);
- Write('The Maximum number of entries have been reached for the Arc Core Table');
- MaxArcEntries := True;
- end;
- end;
- lstlbrfile;
- LbrFilePosition := LbrFilePosition + 32;
- end;
- closelbr;
- PrintLbrHeader;
- HoldDirSave := HoldDir;
- HoldDir := '01';
- PrintLabel(ArcList,1,ArcSrn);
- HoldDir := HoldDirSave;
- end;
- end;
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine Finishes the slip sheet when a floppy is changed }
- { If there are more files than will fit on the slip sheet I just }
- { keep it going even though it may be longer than 5 inches, I }
- { didn't want to create 2 sheets of paper that may get lost. I }
- { would rather have just one long sheet. }
-
- Procedure CompSlipSheet;
- begin
- if PrintOption or FileOption then
- begin
- if PrintColumn = 2 then
- begin
- PrintColumn := 1;
- Column2 := ' ';
- Writeln(FilVar,'| ',Column1,' ',Column2,' |');
- PrintLines := PrintLines + 1;
- end;
- repeat
- Writeln(FilVar,blankline);
- PrintLines := PrintLines + 1;
- until PrintLines > 39;
- Writeln(FilVar,dashes);
- if (PrintPages = 2) or (PrintLines > 43) then { if I've printed more than }
- begin { 43 lines go to a new page }
- PrintPages := 1;
- Write(FilVar,Top_Of_Form); { new page }
- end
- else
- PrintPages := 2;
- PrintLines := 0;
- end;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine does a DOS call to determine the free space left }
- { on the drive. In Regs.DX you use a numeric representation of }
- { the drive you are using. 0 (zero) = default, 1 = A:, 2 = B: etc }
- { In the beginning of the MAIN routine I set up the field to be }
- { used in this routine. }
-
- Procedure HowMuchSpaceLeft;
- begin
- Regs.AX := $3600; { Function used to get free disk space }
- Regs.DX := NumericDriveHold;
- MSDos(Regs);
- FreeAreaOnDisk := Regs.AX; { Sectors per cluster }
- RealWork := Regs.CX; { Bytes per sector }
- FreeAreaOnDisk :=FreeAreaOnDisk * RealWork;
- TotalAreaOnDisk := FreeAreaOnDisk;
- RealWork := Regs.BX; { Number of available clusters }
- FreeAreaOnDisk :=FreeAreaOnDisk * RealWork;
- RealWork := Regs.DX; { Total number of clusters }
- TotalAReaOnDisk := TotalAreaOnDisk * RealWork;
- end;
-
- {----------------------------------------------------------------------------}
- { This routine clears lines 19 thru 22 }
- Procedure Clear_19_22;
- begin
- GoToXY(1,22); ClrEol;
- GoToXY(1,21); ClrEol;
- GoToxy(1,20); ClrEol;
- GoToXY(1,19); ClrEol;
- end;
-
- {----------------------------------------------------------------------------}
- procedure FindFileToPrint; { Yep that is what it is }
-
- begin
- if SRN < Max_Table_Entries then
- SRN := SRN + 1
- else
- begin
- if MaxEntries then
- else
- begin
- GoToXY(1,20);
- Write('The Maximum number of entries have been reached for the Core Table');
- MaxEntries := True;
- end;
- end;
- FileNme := ' '; { Blank it out }
- FileNme := NamR; { Get file name }
- FileNme[length(fileNme)] := ' '; { blank out chr(0) at end }
- FileNme[0] := Chr(13);
- Str(E_Use,FileDir); { Get Directory its in }
- if length(FileDir) = 1 then
- FileDir := '0' + FileDir;
- FindDate; { Make date readable }
- FindTime; { Time also }
- FindSize; { File size }
- FileAttributes := ' ';
- if FileSystem then
- FileAttributes[1] := 's'; { system }
- if FileHidden then
- FileAttributes[2] := 'h'; { hidden }
- if FileRead then
- FileAttributes[3] := 'r'; { read only }
- Str(FileSiz:6:0,FileSizeString);
- SortList[SRN] := FileDir + FileNme + FileMO + '-' + FileDA + '-' +
- FileYR + ' ' + FileHR + ':' + FileMN + ' ' + FileSizeString +
- ' ' + FileAttributes;
- end;
-
- {----------------------------------------------------------------------------}
- (* This routine is the one that starts the ball rolling.
- It Reads the DTA data and extracts the file names or directory
- entries from it. If it is a directory it updates the table
- that is maintained in 'read' order and when you get to all files
- in that directory it then goes up the table one entry to start
- reading that directory.
- {----------------------------------------------------------------------------}
- *)
- procedure StartItGoing;
- const
- Term : CharSet = [^M,^Z];
- var
- TC : char;
- begin
- if not DirOptionContinued then { Am I on my second directory }
- begin
- Write(FilVar,Condenced_Print); { Condenced line spacing }
- Write(FilVar,Line_Spacing); { 1/8 inch line spacing }
- DirOptionContinued := True;
- end;
- NotDir := True;
- SRN := 0;
- MaxEntries := False;
- E := 1; E_Use := 0;
- Buffer := ReadDrive;
- Buffer1 := ''; Buffer2 := Buffer; DirTable[E] := Buffer;
- FillChar(DTA,SizeOf(DTA),0); { Initialize the DTA buffer }
- FillChar(Mask,SizeOf(Mask),0); { Initialize the mask }
- FillChar(NamR,SizeOf(NamR),0); { Initialize the file name }
- SetUpDTA;
- ReadVolume;
- if (VolumeIDRead = ' ') and (VolumeIDWanted in ['y', 'Y'])
- then
- begin
- MkWin(23,13,57,16,2,WindoText,WindoBackground);
- Writeln(' What Volume ID do you want?');
- VolumeIDWrite := '';
- repeat
- InputStr(VolumeIDWrite,11,12,2,Term,TC,'V');
- until TC in Term;
- RmWin;
- WriteVolume;
- ReadVolume;
- end;
- Error := 0;
- While E_Use < E do
- begin
- Set_Up_Dir_Chg;
- ReadFirst; { This does the first read for a directory }
- if (Error = 0) then
- begin
- I := 1; { initialize 'I' to the first element }
- SetUpNamR; { this gets the first name from the directory }
- if NamR[1] = '.' then NotDir := False;
- if NotDir and (Error = 0) then
- begin
- PrintDTA; { This gets the file attributes }
- NumberRecs := NumberRecs + 1;
- if GoodFileName then
- FindFileToPrint; { Build the record }
- end;
- end;
- while (Error = 0) do begin
- NotDir := True;
- ReadNext; { This reads other entries in directory but }
- if (Error = 0) then { the first }
- begin
- I := 1;
- SetUpNamR;
- if NamR[1] = '.' then NotDir := False; { Is it a dot directory }
- if NotDir and (Error = 0) then { No it is not }
- begin
- PrintDTA;
- NumberRecs := NumberRecs + 1;
- if GoodFileName then
- FindFileToPrint; { Build the record and go dupe it }
- end;
- end;
- end;
- end;
- Writeln; { All done reading the directories }
- end; { End of procedure }
-
- {----------------------------------------------------------------------------}
- {$IQUIKSORT.INC}
- {----------------------------------------------------------------------------}
- Procedure SetUpNumericDrive;
- begin
- NumericDriveHold := (Ord(DriveWanted[1]) - Ord('A') + 1);
- end;
-
- {----------------------------------------------------------------------------}
- { This reads the directories, Sorts the data, and then Prints it }
-
- Procedure LetsDoIt;
- begin
- Clear_19_22;
- Write('Reading the Directories');
- StartItGoing;
- Sort_List(SortList,1,SRN);
- HowMuchSpaceLeft; { Check for file space left on the disk here }
- Clear_19_22;
- SRNHold := 0;
- Column := SortList[1]; { Get Dir for First entry in table }
- HoldDir[1] := Column[1]; { Save it }
- HoldDir[2] := Column[2]; { Save it }
- HoldDir[0] := chr(2);
- HoldDirNameSave := ''; { Set up hold area to null }
- BegSub := 1; { Beginning sub = 1 }
- for I := 1 to SRN do { loop until all throught the table }
- begin
- Column := SortList[I];
- HoldDirComp := Column;
- if HoldDirComp <> HoldDir then { When the dir entry changes }
- begin
- PrintLabel(SortList,BegSub,I-1); { Print all entries in this dir }
- PrintArc(BegSub,I-1); { Print any arc files }
- PrintLbr(BegSub,I-1); { Print any Lbr files }
- BegSub := I; { set up for next directory }
- HoldDir := HoldDirComp; { set up for next compare }
- end;
- end;
- PrintLabel(SortList,BegSub,SRN); { Print all lines that match the last }
- { entry in the table }
- PrintArc(BegSub,SRN); { Print any arc files }
- PrintLbr(BegSub,SRN); { Print and LBR files }
- CompSlipSheet;
- Clear_19_22;
- end;
-
- {----------------------------------------------------------------------------}
- { You cannot have the file DIR.DIR on the default drive }
- { Therefore I check if your request is for the default }
- { drive }
-
- Procedure CheckValidDrive;
- begin
- if FirstTimeDrive = false then
- begin
- GetCurrentDrive;
- DefaultDrive[0] := Chr(1);
- FirstTimeDrive := true;
- end;
- if DriveWanted <> DefaultDrive then
- begin
- DriveOK := True;
- ReadDrive := DriveWanted + ':';
- end
- else
- DriveOK := False;
- end;
-
- {----------------------------------------------------------------------------}
- { This wants to know where the floppy drive is }
-
- Procedure AskForDrive;
- begin
- GoToXY(1,18); ClrEol;
- Writeln('What Drive do you want? ');
- Write (' Press * when complete. ');
- GoToXY(25,18);
- repeat
- read(Kbd,Option);
- until (Option in ['A'..'Z','a'..'z','*']);
- DriveWanted := Option;
- if DriveWanted <> '*' then
- begin
- GoToXY(25,18);
- DriveWanted := Upcase(DriveWanted);
- Write(DriveWanted);
- Clear_19_22;
- DriveWanted[0] := Chr(1);
- if fileoption then
- begin
- CheckValidDrive;
- end
- else
- begin
- DriveOK := true;
- ReadDrive := DriveWanted + ':';
- end;
- if not DriveOK then
- begin
- GoToXY(1,20);
- Writeln('You cannot create a print file on the disk you want a cover for!')
- end
- else
- SetUpNumericDrive;
- end;
- end;
-
-
- {----------------------------------------------------------------------------}
- {----------------------------------------------------------------------------}
-
- begin { Main program }
-
- TextColor(ConstText); TextBackground(ConstBackground);
- if Condenced_Print = ' ' then
- begin
- Install_System;
- Halt;
- end;
- NumberRecs := 0; { Zero out Record Count }
- PrintLines := 0;
- Dashes := ' -------------------------------------------------------------------------------------- ';
- FoldLine := '|- - - - - - - - - - - - - - - - - - - Fold Line - - - - - - - - - - - - - - - - - - -|';
- { There should be 88 of them }
- blankline := ('| |');
- { There should be 86 of them }
- FirstTimeDrive := false;
- DriveOK := false;
- PrintOption := true;
- FileOption := false;
- PrintPages := 0;
- SlipSheetLines := 0;
- Assign(FilVar,'Lst:');
- Time; Date;
- FirstTime := True;
- DirOption := False;
- DirOptionContinued := False;
- PrevLine := '';
- ClrScr;
-
- GoToXY(7,1);
- Write('Diskette Cover Program (DisKover) Version 2.00');
- GoToXY(55,1);
- Write(Datestr, ' ', timestr);
- GoToXY(10,3);
- Write('Written and Copyright (C) by');
- GoToXY(20,5);
- Write('Karson W. Morrison - Marty Morrison');
- GoToXY(29,6);
- Write('Caleb Computing Center'); { This is who did it }
- GoToXY(20,7);
- Write('Rd 1, Box 531, Ringoes New Jersey, 08551');
- GoToXY(20,8);
- Write('February 11, 1986 Numbers 13:30'); { And When }
- GoToXY(10,10);
- Write('OPTIONS:');
- GoToXY(11,11);
- Write('Create Diskette Cover for Floppies (Printer): (1)');
- GoToXY(11,12);
- Write('Create Diskette Cover Print File (DIR.DIR): (2)');
- GoToXY(20,21);
- Write('To install Colors and for a different printer hit Esc key.');
- GoToXY(14,18);
- Write('Option: ');
- repeat
- read(Kbd,Option);
- if Option = #27 then
- begin
- Install_System;
- Halt;
- end
- else
- begin
- GoToXY(22,18);
- Write(Upcase(Option));
- GoToXY(22,18);
- end;
- { If the Directory Option is requested then the Option is }
- { toggled on or off. The program default is ON. }
-
- until Option in [ '1', '2'];
- Writeln;
-
- { The following routines turn of or off the messages for the option }
- { requested }
-
- if Option = '1' then
- begin
- GoToXY(61,11);
- Write('ON ');
- GoToXY(22,18);
- end;
-
- if Option = '2' then
- begin
- PrintOption := false; { if you don't want paper }
- FileOption := true; { then I put it on disk }
- Assign(FilVar,'DIR.DIR');
- GoToXY(61,12);
- Write('ON ');
- GoToXY(22,18);
- end;
-
- Rewrite(FilVar); { Open the file for output }
-
- Clear_19_22;
- MkWin(15,13,65,17,2,WindoText,WindoBackground);
- Writeln(' Do you want to create Volume-IDs where missing?');
- Write(' (Y/N)?');
- repeat
- Read(Kbd,VolumeIDWanted);
- until VolumeIdWanted in ['Y', 'N', 'n', 'y'];
- RmWin;
-
- repeat
- AskForDrive;
- if (DriveOK) and (DriveWanted <> '*') then
- LetsDoIt; { Lets do it many times }
- until DriveWanted = '*'; { until you say no more }
-
- if PrintLines <> 0 then
- begin
- CompSlipSheet;
- Write(FilVar,Top_Of_Form); { new page }
- Write(FilVar,Reset_Printer); { reset printer }
- end
- else
- begin
- Write(FilVar,Top_Of_Form); { new page }
- Write(FilVar,Reset_Printer); { reset printer }
- end;
-
- Close(FilVar);
-
- Writeln; ClrEol;
- end.
- (* Well we are now here with the last end just ahead of us.
- It sure has been fun.
- As Roy Rogers used to sing "Happy Trails To You"
-
- Karson Morrison - Marty Morrison
- Caleb Computing Center
- " Yes we can " Numbers 13:30
- *)