Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Switched to TMemo instead of TScintilla, and made to compile under XE7. Doesn't work, though; it still needs to call rsvars.bat first. |
---|---|
Timelines: | family | ancestors | trunk |
Files: | files | file ages | folders |
SHA1: |
ff0999daf051e886a62342b166c34c26 |
User & Date: | tinus 2015-01-27 13:46:23.625 |
Context
2015-01-27
| ||
13:46 | Switched to TMemo instead of TScintilla, and made to compile under XE7. Doesn't work, though; it still needs to call rsvars.bat first. Leaf check-in: ff0999daf0 user: tinus tags: trunk | |
13:05 | Initial check-in of ImmediatePascal project (initially written sometime in 2006), which uses the Delphi 2006 compiler to quickly compile and run a bit of Delphi code. Requires the Scintilla sci_lexer.dll and the TScintilla wrapper component, none of which are included. check-in: a9858dea4a user: tinus tags: trunk | |
Changes
Changes to src/FormMain.dfm.
︙ | ︙ | |||
21 22 23 24 25 26 27 | object lblUses: TLabel Left = 8 Top = 8 Width = 23 Height = 13 Caption = '&Uses' end | | > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | object lblUses: TLabel Left = 8 Top = 8 Width = 23 Height = 13 Caption = '&Uses' end object sciCode: TMemo Left = 8 Top = 34 Width = 577 Height = 264 Anchors = [akLeft, akTop, akRight, akBottom] Color = clWhite Font.Charset = ANSI_CHARSET Font.Color = clBlack Font.Height = -13 Font.Name = 'Consolas' Font.Style = [] Lines.Strings = ( 'var' ' Test: string;' 'begin' ' Test := '#39'Hello world!'#39';' ' WriteLn(Test);' 'end;') ParentFont = False TabOrder = 2 OnKeyDown = sciCodeKeyDown OnKeyUp = sciCodeKeyUp end object btnExecute: TBitBtn Left = 478 Top = 304 Width = 107 Height = 25 Action = actRun |
︙ | ︙ | |||
1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 | end end object pbExecution: TProgressBar Left = 8 Top = 304 Width = 464 Height = 25 TabOrder = 3 Visible = False end object edtUses: TEdit Left = 37 Top = 5 Width = 496 Height = 21 TabOrder = 0 Text = 'SysUtils, Classes, Windows' OnExit = edtUsesExit end object cbxGUI: TCheckBox Left = 539 Top = 7 Width = 46 Height = 17 Alignment = taLeftJustify Caption = '&GUI' TabOrder = 1 end | > > > < < < < < < < < < < < < < < < > | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | end end object pbExecution: TProgressBar Left = 8 Top = 304 Width = 464 Height = 25 Anchors = [akLeft, akTop, akRight] TabOrder = 3 Visible = False end object edtUses: TEdit Left = 37 Top = 5 Width = 496 Height = 21 Anchors = [akLeft, akTop, akRight] TabOrder = 0 Text = 'SysUtils, Classes, Windows' OnExit = edtUsesExit end object cbxGUI: TCheckBox Left = 539 Top = 7 Width = 46 Height = 17 Alignment = taLeftJustify Anchors = [akTop, akRight] Caption = '&GUI' TabOrder = 1 end object ActionList: TActionList Left = 54 Top = 287 object actRun: TAction Category = 'Run' Caption = '&Run' ShortCut = 120 OnExecute = actRunExecute end object actCompile: TAction Category = 'Run' Caption = '&Compile' SecondaryShortCuts.Strings = ( 'Shift+F9') ShortCut = 16504 end end end |
Changes to src/FormMain.pas.
1 2 3 4 5 6 | unit FormMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, | | | | < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | unit FormMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, {SciAutoComplete, SciLexer, SciLexerMemo, SciLexerMod,} StdCtrls, Buttons, ComCtrls, ActnList, ToolWin, System.Actions; type TfrmMain = class(TForm) sciCode: TMemo; btnExecute: TBitBtn; pgResults: TPageControl; tsCompiler: TTabSheet; mmoCompiler: TMemo; tsMessages: TTabSheet; tsResult: TTabSheet; lvwMessages: TListView; |
︙ | ︙ | |||
42 43 44 45 46 47 48 | var frmMain: TfrmMain; implementation uses TypInfo, Registry, ShellAPI, | | | | | | | | | | | | | | | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | var frmMain: TfrmMain; implementation uses TypInfo, Registry, ShellAPI, // ScintillaLanguageManager, RunConsoleUnit; {$R *.dfm} //////////////////////////////////////////////////////////////////////////////////////////////////// procedure TfrmMain.FormCreate(Sender: TObject); //var // Keywords: TSciKeyWordsList; // i: Integer; begin Randomize; // Keywords := sciCode.LanguageManager.LanguageList.Find('Pascal').Keywords; // for i := 0 to Keywords.Count - 1 do begin // sciAutoComplete.AStrings.AddStrings(Keywords.GetKeywordList(i).Keywords); // end; //// sciAutoComplete.AStrings.Assign(Keywords.GetKeywordList(0).Keywords); // sciAutoComplete.FromDocument := False; //// sciAutoComplete.StartAutoComplete; sciCode.SelStart := 31; sciCode.SelLength := 41; end; //////////////////////////////////////////////////////////////////////////////////////////////////// procedure TfrmMain.edtUsesExit(Sender: TObject); begin if Pos('SysUtils', edtUses.Text) = 0 then begin if Length(edtUses.Text) > 0 then begin edtUses.Text := 'SysUtils, ' + edtUses.Text; end else begin edtUses.Text := 'SysUtils'; end; end; end; //////////////////////////////////////////////////////////////////////////////////////////////////// procedure TfrmMain.sciAutoCompleteAutoCSelection(Sender: TObject; text: PAnsiChar); begin // sciAutoComplete.Editor.SelText := text; end; //////////////////////////////////////////////////////////////////////////////////////////////////// procedure TfrmMain.sciCodeKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if(Key = VK_F9) then begin btnExecute.Click; end else if (Shift = [ssCtrl]) and (Key = Ord('/')) then begin // sciCode.CommentBlock; // end else if (Key = VK_SPACE) and (Shift = [ssCtrl]) then begin // if sciAutoComplete.StartAutoCompleteWord(false) = false then begin // ShowMessage('not ok'); // end; // Key := 0; // Shift := []; // end else begin |
︙ | ︙ | |||
197 198 199 200 201 202 203 | Source.SaveToFile(TempFile); finally FreeAndNil(Source); end; // Determine the compiler's path Reg := TRegistry.Create; | > | | > | | > > | < | > > > > > > > > > > > > > > > | | | > > > > | | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | Source.SaveToFile(TempFile); finally FreeAndNil(Source); end; // Determine the compiler's path Reg := TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; if Reg.OpenKeyReadOnly('Software\Borland\BDS\4.0') then begin try BDSPath := IncludeTrailingPathDelimiter(Reg.ReadString('RootDir')); CommandLine := BDSPath + 'bin\dcc32.exe'; finally Reg.CloseKey; end; end; if not FileExists(CommandLine) and Reg.OpenKeyReadOnly('Software\Embarcadero\BDS\15.0') then begin try // TODO: just get the BDS key, then use Reg.GetKeyNames() to get the highest one BDSPath := IncludeTrailingPathDelimiter(Reg.ReadString('RootDir')); CommandLine := BDSPath + 'bin\dcc32.exe'; // TODO: create a batch script, which calls bin\rsvars.bat, then calls dcc32, or msbuild? finally Reg.CloseKey; end; end; finally Reg.Free; end; if not FileExists(CommandLine) then begin raise Exception.Create('Unable to determine compiler location.'); end else begin pbExecution.StepIt; CommandLine := '"' + CommandLine + '" -CC -H -U"' + BDSPath + 'lib" -W+ --no-config -$Q+ -$R+ "' + TempFile + '"'; end; // Run the compiler mmoCompiler.Clear; mmoCompiler.Lines.Add(CommandLine); mmoCompiler.Lines.Add(''); pgResults.ActivePage := tsCompiler; mmoCompiler.Lines.Add(RunConsole(CommandLine, ConsoleExitCode, true)); // Put warnings and errors in listview pbExecution.StepIt; lvwMessages.Clear; for LineIndex := 5 to mmoCompiler.Lines.Count - 3 do begin Message := mmoCompiler.Lines[LineIndex]; if Length(Message) > 0 then begin MessageItem := lvwMessages.Items.Add(); // File name CharPos := Pos('(', Message); ItemText := Copy(Message, 0, CharPos - 1); Message := Copy(Message, CharPos + 1, High(integer)); if SameText(ItemText, TempFile) then begin MessageItem.Caption := ItemText; end; // Line number // take FirstLine, LastLine into account CharPos := Pos(')', Message); ItemText := Copy(Message, 0, CharPos - 1); |
︙ | ︙ | |||
324 325 326 327 328 329 330 | var LineNumber: integer; ErrorIndex: integer; begin if Length(Item.Caption) = 0 then begin Val(Item.SubItems[0], LineNumber, ErrorIndex); if ErrorIndex = 0 then begin | | > > | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | var LineNumber: integer; ErrorIndex: integer; begin if Length(Item.Caption) = 0 then begin Val(Item.SubItems[0], LineNumber, ErrorIndex); if ErrorIndex = 0 then begin // sciCode.GotoLineEnsureVisible(LineNumber - 1); sciCode.SelStart := sciCode.Perform(EM_LINEINDEX, LineNumber - 1, 0); sciCode.Perform(EM_SCROLLCARET, 0, 0); sciCode.SetFocus; end; end; end; end. |
Deleted src/ImmediatePascal.bdsproj.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted src/ImmediatePascal.cfg.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added src/ImmediatePascal.dproj.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <ProjectGuid>{90E0D6A8-6A47-4995-8E35-15654F0E3ECF}</ProjectGuid> <MainSource>ImmediatePascal.dpr</MainSource> <Base>True</Base> <Config Condition="'$(Config)'==''">Debug</Config> <TargetedPlatforms>1</TargetedPlatforms> <AppType>Application</AppType> <FrameworkType>VCL</FrameworkType> <ProjectVersion>16.0</ProjectVersion> <Platform Condition="'$(Platform)'==''">Win32</Platform> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''"> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''"> <Base_Win32>true</Base_Win32> <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''"> <Base_Win64>true</Base_Win64> <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''"> <Cfg_1>true</Cfg_1> <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''"> <Cfg_2>true</Cfg_2> <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''"> <Cfg_2_Win32>true</Cfg_2_Win32> <CfgParent>Cfg_2</CfgParent> <Cfg_2>true</Cfg_2> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Base)'!=''"> <Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File> <Icon_MainIcon>ImmediatePascal_Icon.ico</Icon_MainIcon> <DCC_DebugInformation>1</DCC_DebugInformation> <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo> <DCC_N>true</DCC_N> <VerInfo_Locale>1043</VerInfo_Locale> <DCC_Namespace>Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace)</DCC_Namespace> <DCC_F>false</DCC_F> <VerInfo_Build>3</VerInfo_Build> <DCC_ImageBase>00400000</DCC_ImageBase> <DCC_S>false</DCC_S> <SanitizedProjectName>ImmediatePascal</SanitizedProjectName> <DCC_SymbolReferenceInfo>1</DCC_SymbolReferenceInfo> <DCC_UnitSearchPath>C:\MC\Code\Projects\External\Libraries\Text\Scintilla\delphisci-0.23\d10dcu;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion> <DCC_K>false</DCC_K> <DCC_DcuOutput>..\out\dcu</DCC_DcuOutput> <DCC_ExeOutput>..\out</DCC_ExeOutput> <VerInfo_Keys>CompanyName=Voronwë;FileDescription=Immediate Pascal;FileVersion=1.0.0.3;InternalName=;LegalCopyright=© Martijn Coppoolse;LegalTrademarks=;OriginalFilename=ImmediatePascal.exe;ProductName=Immediate Pascal;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> <DCC_E>false</DCC_E> </PropertyGroup> <PropertyGroup Condition="'$(Base_Win32)'!=''"> <VerInfo_Build>0</VerInfo_Build> <DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon> <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> <VerInfo_Locale>1033</VerInfo_Locale> </PropertyGroup> <PropertyGroup Condition="'$(Base_Win64)'!=''"> <Icon_MainIcon>ImmediatePascal_Icon.ico</Icon_MainIcon> </PropertyGroup> <PropertyGroup Condition="'$(Cfg_1)'!=''"> <DCC_DebugInformation>0</DCC_DebugInformation> <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define> <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo> <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> </PropertyGroup> <PropertyGroup Condition="'$(Cfg_2)'!=''"> <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> <DCC_Optimize>false</DCC_Optimize> <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames> </PropertyGroup> <PropertyGroup Condition="'$(Cfg_2_Win32)'!=''"> <VerInfo_Build>0</VerInfo_Build> <VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> </PropertyGroup> <ItemGroup> <DelphiCompile Include="$(MainSource)"> <MainSource>MainSource</MainSource> </DelphiCompile> <DCCReference Include="FormMain.pas"> <Form>frmMain</Form> </DCCReference> <DCCReference Include="RunConsoleUnit.pas"/> <BuildConfiguration Include="Debug"> <Key>Cfg_2</Key> <CfgParent>Base</CfgParent> </BuildConfiguration> <BuildConfiguration Include="Base"> <Key>Base</Key> </BuildConfiguration> <BuildConfiguration Include="Release"> <Key>Cfg_1</Key> <CfgParent>Base</CfgParent> </BuildConfiguration> </ItemGroup> <ProjectExtensions> <Borland.Personality>Delphi.Personality.12</Borland.Personality> <Borland.ProjectType/> <BorlandProject> <Delphi.Personality> <Source> <Source Name="MainSource">ImmediatePascal.dpr</Source> </Source> <Excluded_Packages> <Excluded_Packages Name="$(BDSBIN)\dcloffice2k210.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages> <Excluded_Packages Name="$(BDSBIN)\dclofficexp210.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages> </Excluded_Packages> </Delphi.Personality> <Platforms> <Platform value="Win32">True</Platform> <Platform value="Win64">False</Platform> </Platforms> </BorlandProject> <ProjectFileVersion>12</ProjectFileVersion> </ProjectExtensions> <Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/> <Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/> </Project> |
Deleted src/ImmediatePascal.res.
cannot compute difference between binary files
Changes to src/RunConsoleUnit.pas.
︙ | ︙ | |||
15 16 17 18 19 20 21 | const BufferSize = 2400; var Security: TSecurityAttributes; ReadPipe, WritePipe: THandle; StartupInfo: TStartUpInfo; ProcessInfo: TProcessInformation; | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | const BufferSize = 2400; var Security: TSecurityAttributes; ReadPipe, WritePipe: THandle; StartupInfo: TStartUpInfo; ProcessInfo: TProcessInformation; Buffer: PAnsiChar; BytesRead: DWord; AppRunning: DWord; BytesAvailable: DWord; begin Result := ''; With Security do begin nLength := SizeOf(TSecurityAttributes); |
︙ | ︙ |