Changeset 117 for trunk/NewView/CharUtilsUnit.pas
- Timestamp:
- Apr 26, 2007, 1:53:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NewView/CharUtilsUnit.pas
r112 r117 27 27 Function CharIsAlpha(const aChar : char) : boolean; 28 28 29 30 // --------------- 31 // ---- PChar ---- 32 // --------------- 33 34 35 // Converts a PChar into a String like StrPas 36 // but conversts at least the first aLength chars 37 Function StrPasWithLength(const aPChar: PChar; const aLength: integer) : String; 38 39 // Returns the difference of the pointers 40 Function PCharPointerDiff(const aMinuend: PChar; const aSubtrahend : PChar ) : Longword; 41 29 42 Implementation 30 43 … … 43 56 44 57 58 // --------------- 59 // ---- PChar ---- 60 // --------------- 61 62 63 // Converts a PChar into a String like StrPas 64 // but conversts at least the first aLength chars 65 Function StrPasWithLength(const aPChar: PChar; const aLength: integer) : String; 66 var 67 i: integer; 68 begin 69 Result := ''; 70 i := 0; 71 while (aPChar[i] <> #0) and (i < aLength) do 72 begin 73 Result := Result + aPChar[i]; 74 inc( i ); 75 end; 76 end; 77 78 79 Function PCharPointerDiff(const aMinuend: PChar; const aSubtrahend : PChar ) : Longword; 80 begin 81 Result := Longword(aMinuend) - Longword(aSubtrahend); 82 end; 83 84 45 85 END.
Note:
See TracChangeset
for help on using the changeset viewer.