ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Global/Functions.pas
(Generate patch)

Comparing oup/current/Global/Functions.pas (file contents):
Revision 113 by alloc, Sun Feb 25 17:20:22 2007 UTC vs.
Revision 321 by alloc, Wed May 6 13:47:23 2009 UTC

# Line 14 | Line 14 | function DataToBin(Data: TByteData): Str
14   function BinToInt(bin: String): Byte;
15   function MakeDatLink(FileID: Integer): Integer;
16  
17 + function ReadString(Stream: TStream; Offset: Integer): String;
18 +
19   function StringSmaller(string1, string2: String): Boolean;
20  
21   function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String;
# Line 144 | Line 146 | begin
146   end;
147  
148  
149 +
150 +
151 + function ReadString(Stream: TStream; Offset: Integer): String;
152 + var
153 +  c: Char;
154 + begin
155 +  if Assigned(Stream) then
156 +  begin
157 +    if Offset >= 0 then
158 +    begin
159 +      Result := '';
160 +      Stream.Seek(Offset, soFromBeginning);
161 +      repeat
162 +        Stream.Read(c, 1);
163 +        if Ord(c) > 0 then
164 +          Result := Result + c;
165 +      until Ord(c) = 0;
166 +    end;
167 +  end;
168 + end;
169 +
170 +
171  
172   function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String;
173   begin

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)