Changeset 151 for trunk/Target.pas
- Timestamp:
- Jun 5, 2024, 10:24:47 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Target.pas
r145 r151 154 154 end; 155 155 156 157 156 resourcestring 158 157 SCompilerNotFound = 'Compiler "%s" not found'; … … 182 181 183 182 implementation 183 184 uses 185 FormConsole; 184 186 185 187 procedure UpdateTranslation; … … 531 533 procedure TTarget.RunFromFile; 532 534 var 533 Process: TProcess;534 535 CompiledFile: string; 535 536 RunFile: string; 536 begin 537 if ExecutorPath = '' then Exit; 538 537 FormConsole: TFormConsole; 538 begin 539 539 CompiledFile := ExtractFilePath(ProjectFileName) + 540 540 CompiledDir + DirectorySeparator + Name + DirectorySeparator + … … 543 543 CompiledDir + DirectorySeparator + Name + DirectorySeparator + 544 544 ExtractFileNameOnly(ProjectFileName) + RunExtension; 545 if not FileExists(ExecutorPath) then546 raise Exception.Create(Format(SExecutorNotFound, [ExecutorPath]));547 545 if FileExists(CompiledFile) then 548 546 try 549 Process := TProcess.Create(nil);547 FormConsole := TFormConsole.Create(nil); 550 548 if ExecutorPath <> '' then begin 551 Process.Executable := LongFileName(ExecutorPath); 552 Process.Parameters.Add(LongFileName(RunFile)); 553 end else Process.Executable := LongFileName(RunFile); 554 Process.ShowWindow := swoShow; 555 Process.Options := [poWaitOnExit, poNewConsole]; 556 Process.Execute; 549 if not FileExists(ExecutorPath) then 550 raise Exception.Create(Format(SExecutorNotFound, [ExecutorPath])); 551 FormConsole.Executable := LongFileName(ExecutorPath); 552 FormConsole.Parameters.Add(LongFileName(RunFile)); 553 end else 554 FormConsole.Executable := LongFileName(RunFile); 555 FormConsole.ShowModal; 557 556 finally 558 Process.Free; 559 end else raise Exception.Create(Format(SCompiledFileNotFound, [CompiledFile])); 557 FormConsole.Free; 558 end 559 else raise Exception.Create(Format(SCompiledFileNotFound, [CompiledFile])); 560 560 end; 561 561
Note:
See TracChangeset
for help on using the changeset viewer.