Changeset 447 for trunk/Packages/Common/UCommon.pas
- Timestamp:
- May 19, 2022, 10:39:34 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UCommon.pas
r424 r447 42 42 clLightRed = TColor($8080FF); 43 43 44 function AddLeadingZeroes(const aNumber, Length : integer) : string;44 function AddLeadingZeroes(const aNumber, Length : Integer) : string; 45 45 function BinToInt(BinStr: string): Int64; 46 46 function BinToHexString(Source: AnsiString): string; … … 96 96 function BinToInt(BinStr : string) : Int64; 97 97 var 98 i : byte;98 I : Byte; 99 99 RetVar : Int64; 100 100 begin 101 101 BinStr := UpperCase(BinStr); 102 if BinStr[ length(BinStr)] = 'B' then Delete(BinStr,length(BinStr),1);102 if BinStr[Length(BinStr)] = 'B' then Delete(BinStr,Length(BinStr),1); 103 103 RetVar := 0; 104 for i := 1 to length(BinStr) do begin105 if not (BinStr[ i] in ['0','1']) then begin104 for I := 1 to Length(BinStr) do begin 105 if not (BinStr[I] in ['0','1']) then begin 106 106 RetVar := 0; 107 107 Break; 108 108 end; 109 RetVar := (RetVar shl 1) + ( byte(BinStr[i]) and 1) ;109 RetVar := (RetVar shl 1) + (Byte(BinStr[I]) and 1) ; 110 110 end; 111 111 … … 435 435 end; 436 436 437 function AddLeadingZeroes(const aNumber, Length : integer) : string;437 function AddLeadingZeroes(const aNumber, Length : Integer) : string; 438 438 begin 439 439 Result := SysUtils.Format('%.*d', [Length, aNumber]) ; … … 614 614 begin 615 615 for J := ReadFrom to Len do 616 if (S[ j] = C) then616 if (S[J] = C) then 617 617 begin 618 618 Result := J; … … 631 631 Inc(I); 632 632 APos := ReadUntil(I, '<'); 633 Result := Result + Copy(S, I, APos - i);633 Result := Result + Copy(S, I, APos - I); 634 634 I := ReadUntil(APos + 1, '>'); 635 635 end;
Note:
See TracChangeset
for help on using the changeset viewer.