From 0181a491d81cb90e60c54413ad299df46a4b2bb7 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Fri, 13 Aug 2004 15:34:50 +0000 Subject: [PATCH] some changes --- compiler/compile/compile.dpr | 10 +++++----- compiler/compile/uFunc.pas | 21 +++++++++++++-------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/compiler/compile/compile.dpr b/compiler/compile/compile.dpr index d944d780..d6604b68 100755 --- a/compiler/compile/compile.dpr +++ b/compiler/compile/compile.dpr @@ -42,13 +42,13 @@ var sr: TSearchRec; i: Word; begin - WriteLn('AMXXSC compile.exe'); - WriteLn(' by the AMX Mod X Dev Team'); + WriteLn('//AMXXSC compile.exe'); + WriteLn('// by the AMX Mod X Dev Team'); WriteLn; if not FileExists(ExtractFilePath(ParamStr(0))+'amxxsc.exe') then begin - WriteLn('Could not find amxxsc.exe'); + WriteLn('// Could not find amxxsc.exe'); AppExit; end; @@ -64,7 +64,7 @@ begin else begin WriteLn; - WriteLn('File not found.'); + WriteLn('// File not found.'); end; end; end @@ -78,7 +78,7 @@ begin end else begin - WriteLn('No file found.'); + WriteLn('// No file found.'); end; FindClose(sr); end; diff --git a/compiler/compile/uFunc.pas b/compiler/compile/uFunc.pas index 9e69238d..e8fda2de 100755 --- a/compiler/compile/uFunc.pas +++ b/compiler/compile/uFunc.pas @@ -65,23 +65,28 @@ begin if (FilePath='') then FilePath := ExtractFilePath(ParamStr(0)); - if FileExists(Compiled) and ( GetAgeFromDat(FileName)=FileAge(Name) ) then - Exit; - WriteLn; WriteLn('//// '+ExtractFileName(FileName)); + + if FileExists(Compiled) and ( GetAgeFromDat(FileName)=FileAge(Name) ) then + begin + WriteLn('// Already compiled.'); + WriteLn('// ----------------------------------------'); + Exit; + end; + Output := TStringList.Create; try cStart := GetTickCount; if not GetConsoleOutput(ExtractFilePath(ParamStr(0))+'amxxsc.exe "'+FilePath+FileName+'" "-o'+Compiled+'"',Output) then begin - WriteLn('Internal error.'); + WriteLn('// Internal error.'); AppExit; end; cEnd := GetTickCount; - for i := 2 to (Output.Count-1) do + for i := 3 to (Output.Count-1) do begin WriteLn('// '+Output.Strings[i]); end; @@ -91,7 +96,7 @@ begin WriteLn('// ----------------------------------------'); Output.Free; except - WriteLn('Internal error.'); + WriteLn('// Internal error.'); AppExit; end; @@ -135,7 +140,7 @@ begin FillChar(SecurityAttr, SizeOf(TSecurityAttributes), 0); SecurityAttr.nLength := SizeOf(SecurityAttr); - SecurityAttr.bInheritHandle := true; + SecurityAttr.bInheritHandle := True; SecurityAttr.lpSecurityDescriptor := nil; CreatePipe(PipeOutputRead, PipeOutputWrite, @SecurityAttr, 0); @@ -158,7 +163,7 @@ begin Stream := TMemoryStream.Create; try - while true do begin + while True do begin Succeed := ReadFile(PipeOutputRead, Buffer, 255, NumberOfBytesRead, nil); if not Succeed then Break; Stream.Write(Buffer, NumberOfBytesRead);