--- oup/current/Global/Functions.pas 2007/02/25 17:20:22 113 +++ oup/current/Global/Functions.pas 2007/08/18 15:51:42 245 @@ -14,6 +14,8 @@ function DataToBin(Data: TByteData): Str function BinToInt(bin: String): Byte; function MakeDatLink(FileID: Integer): Integer; +function ReadString(Stream: TStream; Offset: Integer): String; + function StringSmaller(string1, string2: String): Boolean; function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String; @@ -144,6 +146,29 @@ begin end; + + +function ReadString(Stream: TStream; Offset: Integer): String; +var + i: Integer; + c: Char; +begin + if Assigned(Stream) then + begin + if Offset >= 0 then + begin + Result := ''; + Stream.Seek(Offset, soFromBeginning); + repeat + Stream.Read(c, 1); + if Ord(c) > 0 then + Result := Result + c; + until Ord(c) = 0; + end; + end; +end; + + function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String; begin