git-svn-id: https://spexeah.com:8443/svn/Asuro@259 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron
2017-10-26 03:42:34 +00:00
parent 60c5febc60
commit 38a2363051
7 changed files with 111 additions and 48 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+28
View File
@@ -23,6 +23,8 @@ function stringNew(size : uint32) : pchar;
function stringSize(str : pchar) : uint32;
function stringConcat(str1, str2 : pchar) : pchar;
function stringContains(str : pchar; sub : pchar) : boolean;
function stringToInt(str : pchar) : uint32;
function intToString(i : uint32) : pchar;
implementation
@@ -122,4 +124,30 @@ begin
stringContains:= false;
end;
function stringToInt(str : pchar) : uint32;
var
i : uint32;
x : uint32;
v : uint32;
r : uint32;
begin
stringToInt:= 0;
x:= 1;
r:= 0;
for i:=stringSize(str)-1 downto 0 do begin
v:= byte(str[i]) - 48;
if (v >= 0) and (v <= 9) then begin
r:= r + (v * x);
end;
x:= x * 10;
end;
stringToInt:= r;
end;
function intToString(i : uint32) : pchar;
begin
intToString:= ' ';
end;
end.
+83 -48
View File
File diff suppressed because it is too large Load Diff