Too much to list

This commit is contained in:
mysticbbs 2013-04-01 01:08:04 -04:00
parent bf22de16fa
commit e337c2b676
4 changed files with 26 additions and 18 deletions

View File

@ -65,16 +65,6 @@ Begin
Result := sayi;
End;
Function Byte2Hex (numb: Byte) : String;
Const
HexChars : Array[0..15] of Char = '0123456789abcdef';
begin
// setlength(result, 2);
Byte2Hex[0] := #2;
Byte2Hex[1] := HexChars[numb shr 4];
Byte2Hex[2] := HexChars[numb and 15];
end;
Function Digest2String (Digest: String) : String;
var
count : byte;

View File

@ -35,6 +35,7 @@ Function WildMatch (WildCard, FName: String; IgnoreCase: Boolean) : Boole
Function DirCreate (Str: String) : Boolean;
Function DirExists (Str: String) : Boolean;
Function DirSlash (Str: String) : String;
Function DirLast (CurPath: String) : String;
Function DirChange (Dir: String) : Boolean;
Procedure DirClean (Path: String; Exempt: String);
Function DirFiles (Str: String) : LongInt;
@ -359,6 +360,17 @@ Begin
Result := Str;
End;
Function DirLast (CurPath: String) : String;
Begin
If CurPath[Length(CurPath)] = PathSep Then
Delete (CurPath, Length(CurPath), 1);
While (CurPath[Length(CurPath)] <> PathSep) and (CurPath <> '') Do
Delete (CurPath, Length(CurPath), 1);
Result := DirSlash(CurPath);
End;
Function JustPath (Str: String) : String;
Var
Count : Byte;

View File

@ -28,8 +28,6 @@
-------------------------------------------------------------------------
}
{$DEFINE NEWEDITOR}
{.$DEFINE DEBUG}
{$DEFINE RELEASE}
{.$DEFINE LOGGING}

View File

@ -14,7 +14,7 @@ Function strZero (Num: LongInt) : String;
Function strComma (Num: LongInt) : String;
Function strI2S (Num: LongInt) : String;
Function strH2I (Str: String) : LongInt;
Function strI2H (Num: LongInt) : String;
Function strI2H (Num: LongInt; Idx: Byte) : String;
Function strS2I (Str: String) : LongInt;
Function strI2O (Num: LongInt) : String;
Function strR2S (Num: Real; Deci: Byte) : String;
@ -34,6 +34,7 @@ Function strReplace (Str, OldStr, NewStr: String) : String;
Function strWide2Str (Var Str: String; MaxLen: Byte) : String;
Function strYN (Bol: Boolean) : String;
Function LoCase (Ch: Char) : Char;
Function Byte2Hex (Num: Byte) : String;
Implementation
@ -161,13 +162,11 @@ Begin
End;
End;
Function strI2H (Num: LongInt) : String;
Function strI2H (Num: LongInt; Idx: Byte) : String;
Var
Ch : Char;
Idx : Byte;
Ch : Char;
Begin
Result := '00000000';
Idx := 8;
Result := strRep('0', Idx);
While Num <> 0 Do Begin
Ch := Chr(48 + Byte(Num) AND $0F);
@ -427,4 +426,13 @@ Begin
If Bol Then Result := 'Yes' Else Result := 'No';
End;
Function Byte2Hex (Num: Byte) : String;
Const
HexChars : Array[0..15] of Char = '0123456789abcdef';
Begin
Byte2Hex[0] := #2;
Byte2Hex[1] := HexChars[Num SHR 4];
Byte2Hex[2] := HexChars[Num AND 15];
End;
End.