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 245 by alloc, Sat Aug 18 15:51:42 2007 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 +  i: Integer;
154 +  c: Char;
155 + begin
156 +  if Assigned(Stream) then
157 +  begin
158 +    if Offset >= 0 then
159 +    begin
160 +      Result := '';
161 +      Stream.Seek(Offset, soFromBeginning);
162 +      repeat
163 +        Stream.Read(c, 1);
164 +        if Ord(c) > 0 then
165 +          Result := Result + c;
166 +      until Ord(c) = 0;
167 +    end;
168 +  end;
169 + end;
170 +
171 +
172  
173   function FormatNumber(Value: LongWord; Width: Byte; leadingzeros: Char): String;
174   begin

Diff Legend

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