Sequential option

This commit is contained in:
mysticbbs 2012-09-23 00:59:08 -04:00
parent 6a49bd147d
commit bca312b26a
1 changed files with 23 additions and 14 deletions

View File

@ -10,6 +10,8 @@ Type
IniFile : Text; IniFile : Text;
Buffer : Array[1..1024*4] of Char; Buffer : Array[1..1024*4] of Char;
Opened : Boolean; Opened : Boolean;
Sequential : Boolean;
CurrentCat : String;
Constructor Create (FN: String); Constructor Create (FN: String);
Destructor Destroy; Override; Destructor Destroy; Override;
@ -24,6 +26,8 @@ Uses
Constructor TIniReader.Create (FN: String); Constructor TIniReader.Create (FN: String);
Begin Begin
Sequential := False;
CurrentCat := '';
FileName := FN; FileName := FN;
FileMode := 66; FileMode := 66;
@ -52,8 +56,11 @@ Begin
Category := strUpper(Category); Category := strUpper(Category);
Value := strUpper(Value); Value := strUpper(Value);
Reset (IniFile); If Not Sequential Then Reset (IniFile);
If Sequential and (CurrentCat = Category) Then
GotCat := True
Else
While Not GotCat And Not Eof(IniFile) Do Begin While Not GotCat And Not Eof(IniFile) Do Begin
ReadLn (IniFile, RawStr); ReadLn (IniFile, RawStr);
@ -67,6 +74,8 @@ Begin
If Not GotCat Then Exit; If Not GotCat Then Exit;
CurrentCat := Category;
While Not Eof(IniFile) Do Begin While Not Eof(IniFile) Do Begin
ReadLn (IniFile, RawStr); ReadLn (IniFile, RawStr);