Move GetToken function to testu unit

git-svn-id: trunk@38684 -
This commit is contained in:
pierre 2018-04-04 21:27:07 +00:00
parent 33de492553
commit 450f62efcc
2 changed files with 18 additions and 18 deletions

View File

@ -231,24 +231,6 @@ begin
ForceExtension:=Copy(Hstr,1,j-1);
end;
type
TCharSet = set of char;
function GetToken(var s: string; Delims: TCharSet = [' ']):string;
var
i : longint;
p: PChar;
begin
p:=PChar(s);
i:=0;
while (p^ <> #0) and not (p^ in Delims) do begin
Inc(p);
Inc(i);
end;
GetToken:=Copy(s,1,i);
Delete(s,1,i+1);
end;
procedure mkdirtree(const s:string);
var
SErr, hs : string;

View File

@ -12,6 +12,8 @@ uses
---------------------------------------------------------------------}
type
TCharSet = set of char;
TVerboseLevel=(V_Abort,V_Error,V_Warning,V_Normal,V_Debug,V_SQL);
TConfig = record
@ -79,9 +81,25 @@ Function SplitFileExt(const s:string):string;
Function FileExists (Const F : String) : Boolean;
Function PathExists (Const F : String) : Boolean;
Function IsAbsolute (Const F : String) : boolean;
function GetToken(var s: string; Delims: TCharSet = [' ']):string;
Implementation
function GetToken(var s: string; Delims: TCharSet = [' ']):string;
var
i : longint;
p: PChar;
begin
p:=PChar(s);
i:=0;
while (p^ <> #0) and not (p^ in Delims) do begin
Inc(p);
Inc(i);
end;
GetToken:=Copy(s,1,i);
Delete(s,1,i+1);
end;
function SplitPath(const s:string):string;
var
i : longint;