Changeset 129 for Common


Ignore:
Timestamp:
Jan 17, 2011, 6:55:36 AM (13 years ago)
Author:
george
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r123 r129  
    44
    55uses
    6   Windows, Classes, SysUtils, SpecializedList; //, ShFolder, ShellAPI;
     6  Windows, Classes, SysUtils, SpecializedList, StrUtils; //, ShFolder, ShellAPI;
    77
    88type
    99  TArrayOfByte = array of Byte;
    1010  TArrayOfString = array of string;
     11  TExceptionEvent = procedure(Sender: TObject; E: Exception) of object;
    1112
    1213  TUserNameFormat = (
     
    2223    unfDNSDomainName = 11);
    2324
     25var
     26  ExceptionHandler: TExceptionEvent;
    2427
    2528function IntToBin(Data: Cardinal; Count: Byte): string;
     
    3841procedure SetBit(var Variable: Word; Index: Byte; State: Boolean);
    3942function AddLeadingZeroes(const aNumber, Length : integer) : string;
     43function LastPos(const SubStr: String; const S: String): Integer;
    4044
    4145implementation
     
    6569end;*)
    6670
     71function LastPos(const SubStr: String; const S: String): Integer;
     72begin
     73  Result := Pos(ReverseString(SubStr), ReverseString(S));
     74  if (Result <> 0) then
     75    Result := ((Length(S) - Length(SubStr)) + 1) - Result + 1;
     76end;
     77
    6778function BCDToInt(Value: Byte): Byte;
    6879begin
Note: See TracChangeset for help on using the changeset viewer.