hedgewars/uMisc.pas
changeset 2905 f3c79f7193a9
parent 2882 b9aceb3fe3d6
child 2915 a02f276035e8
--- a/hedgewars/uMisc.pas	Mon Mar 01 19:20:43 2010 +0000
+++ b/hedgewars/uMisc.pas	Mon Mar 01 19:54:33 2010 +0000
@@ -129,13 +129,13 @@
 procedure init_uMisc;
 procedure free_uMisc;
 procedure SplitBySpace(var a, b: shortstring);
-procedure SplitByChar(var a, b: string; c: char);
+procedure SplitByChar(var a, b: ansistring; c: char);
 procedure movecursor(dx, dy: Integer);
 function  hwSign(r: hwFloat): LongInt;
 function  Min(a, b: LongInt): LongInt;
 function  Max(a, b: LongInt): LongInt;
-procedure OutError(Msg: String; isFatalError: boolean);
-procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean);
+procedure OutError(Msg: shortstring; isFatalError: boolean);
+procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean);
 procedure SDLTry(Assert: boolean; isFatal: boolean);
 function  IntToStr(n: LongInt): shortstring;
 function  FloatToStr(n: hwFloat): shortstring;
@@ -185,14 +185,14 @@
 	end else b:= '';
 end;
 
-procedure SplitByChar(var a, b: string; c: char);
+procedure SplitByChar(var a, b: ansistring; c: char);
 var i: LongInt;
 begin
 i:= Pos(c, a);
 if i > 0 then
 	begin
 	b:= copy(a, i + 1, Length(a) - i);
-	byte(a[0]):= Pred(i)
+	setlength(a, Pred(i));
 	end else b:= '';
 end;
 
@@ -223,7 +223,7 @@
 if a > b then Max:= a else Max:= b
 end;
 
-procedure OutError(Msg: String; isFatalError: boolean);
+procedure OutError(Msg: shortstring; isFatalError: boolean);
 begin
 {$IFDEF DEBUGFILE}AddFileLog(Msg);{$ENDIF}
 WriteLnToConsole(Msg);
@@ -235,7 +235,7 @@
    end
 end;
 
-procedure TryDo(Assert: boolean; Msg: string; isFatal: boolean);
+procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean);
 begin
 if not Assert then OutError(Msg, isFatal)
 end;