Changeset 245 for oup/current/Global


Ignore:
Timestamp:
Aug 18, 2007, 5:51:42 PM (17 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • oup/current/Global/Functions.pas

    r113 r245  
    1515function MakeDatLink(FileID: Integer): Integer;
    1616
     17function ReadString(Stream: TStream; Offset: Integer): String;
     18
    1719function StringSmaller(string1, string2: String): Boolean;
    1820
     
    142144begin
    143145  Result := FileID * 256 + 1;
     146end;
     147
     148
     149
     150
     151function ReadString(Stream: TStream; Offset: Integer): String;
     152var
     153  i: Integer;
     154  c: Char;
     155begin
     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;
    144169end;
    145170
Note: See TracChangeset for help on using the changeset viewer.