mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-10 19:35:10 -05:00
Added few wrappers for directly imported FPC functions.
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@495 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
cf07848307
commit
81c123fd41
@ -117,6 +117,10 @@ function ps_Date : TDateTime; ps_decl;
|
||||
begin
|
||||
result := date;
|
||||
end;
|
||||
function ps_GetTickCount : Longword; ps_decl;
|
||||
begin
|
||||
result := GetTickCount;
|
||||
end;
|
||||
procedure HakunaMatata; ps_decl;
|
||||
begin;
|
||||
OpenWebPage('http://www.youtube.com/v/ejEVczA8PLU&hl=en&fs=1&autoplay=1');
|
||||
|
@ -1 +1 @@
|
||||
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;
|
||||
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 ps_BoolToStr(bool : boolean) : string; ps_decl;
begin;
result := BoolToStr(bool,true);
end;
function ps_IntToStr(int : integer) : string; ps_decl;
begin
result := inttostr(int);
end;
function ps_FloatToStr(flt : extended) : string; ps_decl;
begin
result := floattostr(flt);
end;
function ps_StrToInt(value: String): Integer; ps_decl;
begin
result := StrToInt(value);
end;
function ps_StrToIntDef(value: String; default: Integer): Integer; ps_decl;
begin
result := StrToIntDef(value,default);
end;
function ps_StrToFloat(value: String): Extended; ps_decl;
begin
result := StrToFloat(value);
end;
function ps_StrToFloatDef(value: String; default: Extended): Extended; ps_decl;
begin
result := StrToFloatDef(value,default);
end;
function ps_StrToBool(value: String): Boolean;ps_decl;
begin
result := StrToBool(value);
end;
function ps_StrToBoolDef(value: String; default: Boolean): Boolean; ps_decl;
begin
result := StrToBoolDef(value,default);
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;
|
@ -103,8 +103,8 @@ AddFunction(@psWait, 'procedure wait(t: integer);');
|
||||
AddFunction(@psWait, 'procedure Sleep(t: integer);');
|
||||
AddFunction(@ps_now,'function Now: TDateTime;');
|
||||
AddFunction(@ps_date,'function Date : TDateTime;');
|
||||
AddFunction(@GetTickCount, 'function GetSystemTime: LongWord;');
|
||||
AddFunction(@GetTickCount, 'function GetTickCount: LongWord;');
|
||||
AddFunction(@ps_GetTickCount, 'function GetSystemTime: LongWord;');
|
||||
AddFunction(@ps_GetTickCount, 'function GetTickCount: LongWord;');
|
||||
AddFunction(@GetTimeRunning,'function GetTimeRunning: LongWord;');
|
||||
AddFunction(@ps_DecodeTime,'procedure DecodeTime(DateTime : TDateTime; var Hour,Min,Sec,MSec : word);');
|
||||
AddFunction(@ps_DecodeDate,'procedure DecodeDate ( const SourceDate : TDateTime; out Year, Month, Day : Word );');
|
||||
@ -125,15 +125,15 @@ AddFunction(@Capitalize,'function Capitalize(str : string) : string;');
|
||||
AddFunction(@psFormat,'function Format(const fmt : string;const args : array of const) : string;');
|
||||
AddFunction(nil,'function ToStr(x) : string;');
|
||||
AddFunction(@ps_Between,'function Between(s1, s2, str: string): string;');
|
||||
AddFunction(@IntToStr, 'function IntToStr(value: Integer): String;');
|
||||
AddFunction(@FloatToStr, 'function FloatToStr(value: Extended): String;');
|
||||
AddFunction(@psBoolToStr, 'function BoolToStr(value: Boolean): String;');
|
||||
AddFunction(@StrToInt, 'function StrToInt(value: String): Integer;');
|
||||
AddFunction(@StrToIntDef, 'function StrToIntDef(value: String; default: Integer): Integer;');
|
||||
AddFunction(@StrToFloat, 'function StrToFloat(value: String): Extended;');
|
||||
AddFunction(@StrToFloatDef, 'function StrToFloatDef(value: String; default: Extended): Extended;');
|
||||
AddFunction(@StrToBool, 'function StrToBool(value: String): Boolean;');
|
||||
AddFunction(@StrToBoolDef, 'function StrToBoolDef(value: String; default: Boolean): Boolean;');
|
||||
AddFunction(@ps_IntToStr, 'function IntToStr(value: Integer): String;');
|
||||
AddFunction(@ps_FloatToStr, 'function FloatToStr(value: Extended): String;');
|
||||
AddFunction(@ps_BoolToStr, 'function BoolToStr(value: Boolean): String;');
|
||||
AddFunction(@ps_StrToInt, 'function StrToInt(value: String): Integer;');
|
||||
AddFunction(@ps_StrToIntDef, 'function StrToIntDef(value: String; default: Integer): Integer;');
|
||||
AddFunction(@ps_StrToFloat, 'function StrToFloat(value: String): Extended;');
|
||||
AddFunction(@ps_StrToFloatDef, 'function StrToFloatDef(value: String; default: Extended): Extended;');
|
||||
AddFunction(@ps_StrToBool, 'function StrToBool(value: String): Boolean;');
|
||||
AddFunction(@ps_StrToBoolDef, 'function StrToBoolDef(value: String; default: Boolean): Boolean;');
|
||||
|
||||
{web}
|
||||
SetCurrSection('Web');
|
||||
|
Loading…
Reference in New Issue
Block a user