home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tptools.zip / EDINST.ZIP / EDIOPT.INC < prev    next >
Text File  |  1987-12-21  |  2KB  |  72 lines

  1. {                          EDIOPT.INC
  2.                            EDINST 4.0
  3.              Copyright (c) 1985, 87 by Borland International, Inc.            }
  4.  
  5.   procedure OptionInstall;
  6.     {-Customize the FirstEd editing defaults}
  7.   var
  8.     DefExt : string[3];
  9.     Ch : Char;
  10.     MainOfs : LongInt;
  11.  
  12.     procedure ShowDefault(var Def : Integer);
  13.       {-show a default value, prompt, and get new value}
  14.     var
  15.       Good : Boolean;
  16.       S : string;
  17.       Code, I : Integer;
  18.     begin
  19.       Good := True;
  20.       repeat
  21.         Code := 0;
  22.         Write('Press <Enter> to leave unchanged [', Def, '] ');
  23.         {* BufLen := 3; *}
  24.         ReadLn(S);
  25.         if Length(S) <> 0 then begin
  26.           Val(S, I, Code);
  27.           Good := (Code = 0);
  28.           if Good then
  29.             Def := I;
  30.         end;
  31.         if not(Good) then
  32.           WriteLn('Illegal number. Try again....');
  33.       until Good;
  34.       WriteLn;
  35.     end;                     {showdefault}
  36.  
  37.   begin                      {OptionInstall}
  38.  
  39.     {Search for main installation ID string}
  40.     MainOfs := FindString(MIDstring, MainDefaults, SizeOf(MainDefaults));
  41.     if MainOfs = 0 then
  42.       HaltError('Main defaults ID string not found in '+ProgName);
  43.  
  44.     with MainDefaults do begin
  45.  
  46.       WriteLn('Enter number of lines to reserve on Undelete stack.');
  47.       ShowDefault(SaveUndoLimit);
  48.  
  49.       SaveInsertMode :=
  50.       YesNo('Do you want Insert Mode when '+ProgName+' starts?', 'Y');
  51.  
  52.       WriteLn;
  53.       SaveIndentMode :=
  54.       YesNo('Do you want AutoIndent Mode when '+ProgName+' starts?', 'Y');
  55.  
  56.       WriteLn;
  57.       WriteLn('Enter 3 letter default extension to apply to filenames.');
  58.       WriteLn('Press <Enter> for none');
  59.       {* BufLen := 3; *}
  60.       ReadLn(DefExt);
  61.       StUpcase(DefExt);
  62.       DefExtension := DefExt;
  63.       WriteLn;
  64.  
  65.     end;
  66.  
  67.     {write modified defaults}
  68.     if not ModifyDefaults(MainOfs, MainDefaults, SizeOf(MainDefaults)) then
  69.       HaltError('Error writing main defaults to '+ProgName);
  70.  
  71.   end;                       {OptionInstall}
  72.