fpintf.pas 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Integrated Development Environment
  4. Copyright (c) 1998 by Berczi Gabor
  5. Misc routines for 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. unit FPIntf;
  13. interface
  14. { Run }
  15. function GetRunParameters: string;
  16. procedure SetRunParameters(const Params: string);
  17. { Compile }
  18. procedure Compile(const FileName: string);
  19. procedure SetPrimaryFile(const fn:string);
  20. implementation
  21. uses
  22. Compiler,
  23. {$ifndef NODEBUG}
  24. FPDebug,
  25. {$endif NODEBUG}
  26. FPVars,FPUtils,FPSwitch;
  27. {****************************************************************************
  28. Run
  29. ****************************************************************************}
  30. var
  31. RunParameters : string;
  32. function GetRunParameters: string;
  33. begin
  34. GetRunParameters:=RunParameters;
  35. end;
  36. procedure SetRunParameters(const Params: string);
  37. begin
  38. RunParameters:=Params;
  39. If assigned(Debugger) then
  40. Debugger^.SetArgs(RunParameters);
  41. end;
  42. {****************************************************************************
  43. Compile
  44. ****************************************************************************}
  45. procedure Compile(const FileName: string);
  46. var
  47. cmd : string;
  48. begin
  49. cmd:='[fp.cfg] -d'+SwitchesModeStr[SwitchesMode];
  50. if LinkAfter then
  51. cmd:=cmd+' -s';
  52. { Add the switches from the primary file }
  53. if PrimaryFileSwitches<>'' then
  54. cmd:=cmd+' '+PrimaryFileSwitches;
  55. { call the compiler }
  56. Compiler.Compile(cmd+' '+FileName);
  57. end;
  58. procedure SetPrimaryFile(const fn:string);
  59. var
  60. t : text;
  61. begin
  62. PrimaryFile:='';
  63. PrimaryFileMain:='';
  64. PrimaryFileSwitches:='';
  65. PrimaryFilePara:='';
  66. if UpcaseStr(ExtOf(fn))='.PRI' then
  67. begin
  68. assign(t,fn);
  69. {$I-}
  70. reset(t);
  71. if ioresult=0 then
  72. begin
  73. PrimaryFile:=fn;
  74. readln(t,PrimaryFileMain);
  75. readln(t,PrimaryFileSwitches);
  76. readln(t,PrimaryFilePara);
  77. close(t);
  78. end;
  79. {$I+}
  80. EatIO;
  81. end
  82. else
  83. begin
  84. PrimaryFile:=fn;
  85. PrimaryFileMain:=fn;
  86. end;
  87. if PrimaryFilePara<>'' then
  88. SetRunParameters(PrimaryFilePara);
  89. end;
  90. end.
  91. {
  92. $Log$
  93. Revision 1.7 1999-09-16 14:34:59 pierre
  94. + TBreakpoint and TWatch registering
  95. + WatchesCollection and BreakpointsCollection stored in desk file
  96. * Syntax highlighting was broken
  97. Revision 1.6 1999/06/30 23:58:15 pierre
  98. + BreakpointsList Window implemented
  99. with Edit/New/Delete functions
  100. + Individual breakpoint dialog with support for all types
  101. ignorecount and conditions
  102. (commands are not yet implemented, don't know if this wolud be useful)
  103. awatch and rwatch have problems because GDB does not annotate them
  104. I fixed v4.16 for this
  105. Revision 1.5 1999/06/21 23:38:37 pierre
  106. + support for LinkAfter var
  107. Revision 1.4 1999/03/12 01:12:22 peter
  108. * extended primaryfile to load a .pri file
  109. Revision 1.3 1999/02/05 13:51:41 peter
  110. * unit name of FPSwitches -> FPSwitch which is easier to use
  111. * some fixes for tp7 compiling
  112. Revision 1.2 1998/12/28 15:47:45 peter
  113. + Added user screen support, display & window
  114. + Implemented Editor,Mouse Options dialog
  115. + Added location of .INI and .CFG file
  116. + Option (INI) file managment implemented (see bottom of Options Menu)
  117. + Switches updated
  118. + Run program
  119. Revision 1.1 1998/12/22 14:27:54 peter
  120. * moved
  121. Revision 1.4 1998/12/22 10:39:43 peter
  122. + options are now written/read
  123. + find and replace routines
  124. }