--- oup/current/Global/Functions.pas 2007/02/21 03:28:48 111 +++ oup/current/Global/Functions.pas 2007/02/25 17:20:22 113 @@ -5,7 +5,6 @@ interface uses TypeDefs, Classes; function BoolToStr(bool: Boolean): String; -function HexToLong(hex: String): LongWord; function Decode_Int(buffer: TByteData): LongWord; function Encode_Int(input: LongWord): TByteData; function Decode_Float(buffer: TByteData): Single; @@ -13,6 +12,7 @@ function Encode_Float(input: Single): TB function IntToBin(Value: Byte): String; function DataToBin(Data: TByteData): String; function BinToInt(bin: String): Byte; +function MakeDatLink(FileID: Integer): Integer; function StringSmaller(string1, string2: String): Boolean; @@ -48,37 +48,6 @@ begin end; -function HexToLong(hex: String): LongWord; - - function NormalizeHexString(var hex: String): Boolean; - var - i: Byte; - begin - Result := True; - if hex[1] = '$' then - begin - for i := 1 to Length(hex) - 1 do - hex[i] := hex[i + 1]; - SetLength(hex, Length(hex) - 1); - end; - if (hex[1] = '0') and (UpCase(hex[2]) = 'X') then - begin - for i := 1 to Length(hex) - 2 do - hex[i] := hex[i + 2]; - SetLength(hex, Length(hex) - 2); - end; - if Length(hex) = 0 then - Result := False; - end; - -begin - if NormalizeHexString(hex) then - Result := StrToInt(hex) - else - Result := 0; -end; - - function Decode_Int(buffer: TByteData): LongWord; begin Result := buffer[0] + buffer[1] * 256 + buffer[2] * 256 * 256 + buffer[3] * 256 * 256 * 256; @@ -169,6 +138,12 @@ begin end; +function MakeDatLink(FileID: Integer): Integer; +begin + Result := FileID * 256 + 1; +end; + + function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String; begin