Browse Source

* use default command line switches only if fp.cfg not found

pierre 25 years ago
parent
commit
73edccea34
1 changed files with 17 additions and 7 deletions
  1. 17 7
      ide/text/fpswitch.pas

+ 17 - 7
ide/text/fpswitch.pas

@@ -140,6 +140,7 @@ procedure ReadSwitches(const fn:string);
 
 
 { initialize }
 { initialize }
 procedure InitSwitches;
 procedure InitSwitches;
+procedure SetDefaultSwitches;
 procedure DoneSwitches;
 procedure DoneSwitches;
 function  GetSourceDirectories : string;
 function  GetSourceDirectories : string;
 
 
@@ -597,7 +598,10 @@ begin
    reset(CfgFile);
    reset(CfgFile);
   {$I+}
   {$I+}
   if ioresult<>0 then
   if ioresult<>0 then
-   exit;
+   begin
+     SetDefaultSwitches;
+     exit;
+   end;
   OldSwitchesMode:=SwitchesMode;
   OldSwitchesMode:=SwitchesMode;
   SwitchesMode:=om_Normal;
   SwitchesMode:=om_Normal;
   while not eof(CfgFile) do
   while not eof(CfgFile) do
@@ -686,9 +690,6 @@ end;
 
 
 procedure InitSwitches;
 procedure InitSwitches;
 
 
-var
-   i,OldSwitchesMode : TSwitchMode;
-
 begin
 begin
   New(SyntaxSwitches,Init('S'));
   New(SyntaxSwitches,Init('S'));
   with SyntaxSwitches^ do
   with SyntaxSwitches^ do
@@ -818,6 +819,13 @@ begin
     SwitchesPath:=SwitchesName;
     SwitchesPath:=SwitchesName;
   SwitchesPath:=FExpand(SwitchesPath);
   SwitchesPath:=FExpand(SwitchesPath);
 
 
+end;
+
+procedure SetDefaultSwitches;
+var
+   i,OldSwitchesMode : TSwitchMode;
+
+begin
   { setup some useful defaults }
   { setup some useful defaults }
   OldSwitchesMode:=SwitchesMode;
   OldSwitchesMode:=SwitchesMode;
   for i:=low(TSwitchMode) to high(TSwitchMode) do
   for i:=low(TSwitchMode) to high(TSwitchMode) do
@@ -872,7 +880,6 @@ begin
   SwitchesMode:=OldSwitchesMode;
   SwitchesMode:=OldSwitchesMode;
 end;
 end;
 
 
-
 procedure DoneSwitches;
 procedure DoneSwitches;
 begin
 begin
   dispose(SyntaxSwitches,Done);
   dispose(SyntaxSwitches,Done);
@@ -898,7 +905,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1999-10-14 14:22:23  florian
+  Revision 1.15  2000-01-10 15:52:53  pierre
+    * use default command line switches only if fp.cfg not found
+
+  Revision 1.14  1999/10/14 14:22:23  florian
     * if no ini file is found the ide uses some useful defaults
     * if no ini file is found the ide uses some useful defaults
 
 
   Revision 1.13  1999/04/29 09:36:12  peter
   Revision 1.13  1999/04/29 09:36:12  peter
@@ -977,4 +987,4 @@ end.
     + Switches updated
     + Switches updated
     + Run program
     + Run program
 
 
-}
+}