Changeset 28 for trunk/Forms/UMainForm.pas
- Timestamp:
- Feb 13, 2012, 12:26:12 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 4 4 backup 5 5 LazFuckIDE 6 compiled
-
- Property svn:ignore
-
trunk/Forms/UMainForm.pas
r27 r28 166 166 SNumberGeneration = 'Number generation'; 167 167 SProgramExited = 'Program exited'; 168 SCompilerNotFound = 'Compiler "%s" not found';169 SCompiledFileNotFound = 'Program compiled file "%s" not found';170 168 171 169 { TMainForm } … … 459 457 460 458 procedure TMainForm.ACompileAndRunExecute(Sender: TObject); 461 var462 Process: TProcess;463 CompiledFile: string;464 459 begin 465 460 with TBrainFuckCompiler(Compilers[CompilerIndex]) do begin … … 467 462 Source := MemoSource.Text; 468 463 ProgramName := ExtractFileNameOnly(ProjectFileName); 464 ProjectFileName := Self.ProjectFileName; 469 465 Compile; 470 CompiledFile := ExtractFilePath(ProjectFileName) + 471 'compiled' + DirectorySeparator + Name + DirectorySeparator + 472 ExtractFileNameOnly(ProjectFileName) + SourceExtension; 473 ForceDirectoriesUTF8(ExtractFilePath(CompiledFile)); 474 with TStringList.Create do 475 try 476 Text := Output; 477 SaveToFile(CompiledFile); 478 finally 479 Free; 480 end; 481 if FileExistsUTF8(CompilerPath) then 482 try 483 Process := TProcess.Create(nil); 484 Process.CommandLine := '"' + CompilerPath + '" "' + CompiledFile + '"'; 485 Process.Options := [poWaitOnExit]; 486 Process.Execute; 487 finally 488 Process.Free; 489 end else raise Exception.Create(Format(SCompilerNotFound, [CompilerPath])); 490 491 if CompiledExtension <> '' then begin 492 CompiledFile := ExtractFilePath(CompiledFile) + ExtractFileNameOnly(CompiledFile) + CompiledExtension; 493 if FileExistsUTF8(CompiledFile) then 494 try 495 Process := TProcess.Create(nil); 496 Process.CommandLine := '"' + CompiledFile + '"'; 497 Process.Options := [poWaitOnExit]; 498 Process.Execute; 499 finally 500 Process.Free; 501 end else raise Exception.Create(Format(SCompiledFileNotFound, [CompiledFile])); 502 end; 466 CompileToFile; 467 if CompiledExtension <> '' then Run; 503 468 end; 504 469 end;
Note:
See TracChangeset
for help on using the changeset viewer.