hedgewars/uFLUtils.pas
branchqmlfrontend
changeset 10434 1614b13ad35e
child 10440 b74a7bbe224e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/uFLUtils.pas	Tue Sep 30 00:54:04 2014 +0400
@@ -0,0 +1,28 @@
+unit uFLUtils;
+interface
+
+function str2PChar(const s: shortstring): PChar;
+function intToStr(n: LongInt): shortstring;
+
+implementation
+
+var
+    str2PCharBuffer: array[0..255] of char;
+
+function str2PChar(const s: shortstring): PChar;
+var i: Integer;
+begin
+   for i:= 1 to Length(s) do
+      begin
+      str2PCharBuffer[i - 1] := s[i];
+      end;
+   str2PCharBuffer[Length(s)]:= #0;
+   str2PChar:= @(str2PCharBuffer[0]);
+end;
+
+function intToStr(n: LongInt): shortstring;
+begin
+    str(n, intToStr)
+end;
+
+end.