fp.pas 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Main program of the IDE
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. program FP;
  13. uses
  14. {$ifdef IDEHeapTrc}
  15. HeapTrc,
  16. {$endif IDEHeapTrc}
  17. Dos,
  18. BrowCol,
  19. FPIni,FPViews,FPConst,FPVars,FPUtils,FPIde,FPHelp,FPSwitch,FPUsrScr,
  20. FPTools,FPDebug,FPTemplt,FPCatch;
  21. procedure ProcessParams(BeforeINI: boolean);
  22. function IsSwitch(const Param: string): boolean;
  23. begin
  24. IsSwitch:=(Param<>'') and (Param[1]<>DirSep) { <- allow UNIX root-relative paths }
  25. and (Param[1] in ['-','/']); { <- but still accept dos switch char, eg. '/' }
  26. end;
  27. var I: integer;
  28. Param: string;
  29. begin
  30. for I:=1 to ParamCount do
  31. begin
  32. Param:=ParamStr(I);
  33. if IsSwitch(Param) then
  34. begin
  35. Param:=copy(Param,2,255);
  36. if Param<>'' then
  37. case Upcase(Param[1]) of
  38. 'C' : { custom config file (BP compatiblity) }
  39. if BeforeINI then
  40. INIPath:=copy(Param,2,255);
  41. 'R' : { enter the directory last exited from (BP comp.) }
  42. begin
  43. Param:=copy(Param,2,255);
  44. if (Param='') or (Param='+') then
  45. StartupOptions:=StartupOptions or soReturnToLastDir
  46. else
  47. if (Param='-') then
  48. StartupOptions:=StartupOptions and (not soReturnToLastDir);
  49. end;
  50. end;
  51. end
  52. else
  53. if not BeforeINI then
  54. MyApp.Open(Param);
  55. end;
  56. end;
  57. BEGIN
  58. {$ifdef DEV}HeapLimit:=4096;{$endif}
  59. writeln('þ Free Pascal IDE Version '+VersionStr);
  60. StartupDir:=CompleteDir(FExpand('.'));
  61. ProcessParams(true);
  62. InitBreakpoints;
  63. InitReservedWords;
  64. InitHelpFiles;
  65. InitSwitches;
  66. InitINIFile;
  67. InitUserScreen;
  68. InitTools;
  69. InitTemplates;
  70. { load old options }
  71. ReadINIFile;
  72. ReadSwitches(SwitchesPath);
  73. MyApp.Init;
  74. ProcessParams(false);
  75. MyApp.Run;
  76. MyApp.Done;
  77. WriteSwitches(SwitchesPath);
  78. WriteINIFile;
  79. DoneTemplates;
  80. DoneTools;
  81. DoneUserScreen;
  82. DoneSwitches;
  83. DoneHelpFiles;
  84. DoneReservedWords;
  85. DoneBrowserCol;
  86. DoneDebugger;
  87. DoneBreakpoints;
  88. END.
  89. {
  90. $Log$
  91. Revision 1.12 1999-02-20 15:18:25 peter
  92. + ctrl-c capture with confirm dialog
  93. + ascii table in the tools menu
  94. + heapviewer
  95. * empty file fixed
  96. * fixed callback routines in fpdebug to have far for tp7
  97. Revision 1.11 1999/02/18 13:44:30 peter
  98. * search fixed
  99. + backward search
  100. * help fixes
  101. * browser updates
  102. Revision 1.10 1999/02/15 09:07:10 pierre
  103. * HEAPTRC conditionnal renamed IDEHEAPTRC
  104. Revision 1.9 1999/02/10 09:55:43 pierre
  105. + Memory tracing if compiled with -dHEAPTRC
  106. * Many memory leaks removed
  107. Revision 1.8 1999/02/08 09:30:59 florian
  108. + some split heap stuff, in $ifdef TEMPHEAP
  109. Revision 1.7 1999/02/05 13:51:38 peter
  110. * unit name of FPSwitches -> FPSwitch which is easier to use
  111. * some fixes for tp7 compiling
  112. Revision 1.6 1999/01/21 11:54:10 peter
  113. + tools menu
  114. + speedsearch in symbolbrowser
  115. * working run command
  116. Revision 1.5 1999/01/12 14:29:31 peter
  117. + Implemented still missing 'switch' entries in Options menu
  118. + Pressing Ctrl-B sets ASCII mode in editor, after which keypresses (even
  119. ones with ASCII < 32 ; entered with Alt+<###>) are interpreted always as
  120. ASCII chars and inserted directly in the text.
  121. + Added symbol browser
  122. * splitted fp.pas to fpide.pas
  123. }