1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-02 05:42:17 -05:00
Simba/trunk/Units/MMLAddon/PSInc/Wrappers/strings.inc
Raymond 7bece8ede2 Added GetKeyCode to the manager.. Not sure if it needs a default implementation?
Added some functions needed for compiling SRL.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@483 3f818213-9676-44b0-a9b4-5e4c4e03d09d
2010-01-26 19:38:27 +00:00

1 line
891 B
PHP

function psFormat(const fmt : string;const args : array of const) : string; ps_decl;
ps_decl;
begin;
Result := Format(fmt,Args);
end;
function Capitalize(str : string) : string;
ps_decl;
var
i , l : integer;
cap : boolean;
begin;
result := str;
l := length(str);
cap := true;
for i := 1 to l do
if cap and (str[i] in ['a'..'z'] + ['A'..'Z']) then
begin;
result[i] := UpperCase(str[i])[1];
cap := false;
end else if not (str[i] in ['a'..'z'] + ['A'..'Z']) then
cap := true;
end;
function psBoolToStr(bool : boolean) : string; ps_decl;
begin;
result := BoolToStr(bool,true);
end;
function ps_Between(s1, s2, str: string): string; ps_decl;
var
I,J : integer;
begin;
Result := '';
I := pos(s1,str);
if I > 0 then
begin;
i := i + length(s1);
j := posex(s2,str,i);
if j > 0 then
Result := copy(str,i,j-i);
end;
end;