| 18 | 
   | 
     procedure UpdateListCache; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 19 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 20 | 
   | 
     function GetLinksToFile(FileID: Integer): TLinks; | 
 
 
 
 
 
 
 
 
 
 | 21 | 
 – | 
     function GetLinksFromFile(FileID: Integer): TLinks; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 21 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 22 | 
   | 
     function GetFileInfo(FileID: Integer): TFileInfo; override; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 23 | 
   | 
     function GetFilesList(Ext: String; Pattern: String; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 46 | 
   | 
 implementation | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 47 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 48 | 
   | 
 uses | 
 
 
 
 
 
 
 
 
 
 
 
 | 49 | 
 < | 
   SysUtils, Data, Functions, ABSDecUtil, DB, DatLinks; | 
 
 
 
 
 
 
 
 
 
 | 49 | 
 > | 
   SysUtils, Data, Functions, ABSDecUtil, DB, DatLinks, StrUtils; | 
 
 
 
 
 
 
 
 
 
 
 
 | 50 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 51 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 52 | 
   | 
 (* | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 66 | 
   | 
   FFileName := DBFilename; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 67 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 68 | 
   | 
   FDatabase := TABSDatabase.Create(nil); | 
 
 
 
 
 
 
 
 
 | 69 | 
 + | 
   FDatabase.Exclusive := True; | 
 
 
 
 
 
 
 
 
 | 70 | 
 + | 
   FDatabase.MultiUser := False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 71 | 
   | 
   FDatabase.DatabaseName := 'OLDBcon' + IntToStr(ConnectionID); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 72 | 
   | 
   FDatabase.DatabaseFileName := DBFilename; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 73 | 
   | 
   FDatabase.Open; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 74 | 
   | 
   FQuery := TABSQuery.Create(FDatabase); | 
 
 
 
 
 
 
 
 
 | 75 | 
 + | 
   FQuery.DisableControls; | 
 
 
 
 
 
 
 
 
 | 76 | 
 + | 
   FQuery.RequestLive := False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 77 | 
   | 
   FQuery.DatabaseName := 'OLDBcon' + IntToStr(ConnectionID); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 | 
   | 
   FQuery.SQL.Text := 'SELECT [name],[value] FROM globals ORDER BY [name] ASC'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 79 | 
   | 
   FQuery.Open; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 91 | 
   | 
     if FQuery.FieldByName('name').AsString = 'lvl' then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 92 | 
   | 
       FLevelNumber := StrToInt(FQuery.FieldByName('value').AsString); | 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | 
 < | 
     if FQuery.FieldByName('name').AsString = 'DataOS' then | 
 
 
 
 
 
 
 
 
 
 | 93 | 
 > | 
     if FQuery.FieldByName('name').AsString = 'os' then | 
 
 
 
 
 
 
 
 
 
 
 
 | 94 | 
   | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 95 | 
   | 
       if FQuery.FieldByName('value').AsString = 'WIN' then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 96 | 
   | 
         FDataOS := DOS_WIN | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 112 | 
   | 
   FChangeRights := [CR_EditDat, CR_EditRaw, CR_ResizeDat, CR_ResizeRaw]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 113 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 114 | 
   | 
   UpdateListCache; | 
 
 
 
 
 
 
 
 
 | 115 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 | 116 | 
 + | 
   inherited; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 117 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 118 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 119 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 198 | 
   | 
   FQuery.Close; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 199 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 200 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 | 196 | 
 – | 
 function TAccess_OUP_ADB.GetLinksFromFile(FileID: Integer): TLinks; | 
 
 
 
 
 
 
 
 
 
 | 197 | 
 – | 
 var | 
 
 
 
 
 
 
 
 
 
 | 198 | 
 – | 
   i: Integer; | 
 
 
 
 
 
 
 
 
 
 | 199 | 
 – | 
 begin | 
 
 
 
 
 
 
 
 
 
 | 200 | 
 – | 
   SetLength(Result.ByName, 0); | 
 
 
 
 
 
 
 
 
 
 | 201 | 
 – | 
   FQuery.SQL.Text := 'SELECT src_link_offset, target_id FROM linkmap WHERE src_id = ' + IntToStr(FileID) + ' ORDER BY target_id ASC;'; | 
 
 
 
 
 
 
 
 
 
 | 202 | 
 – | 
   FQuery.Open; | 
 
 
 
 
 
 
 
 
 
 | 203 | 
 – | 
   SetLength(Result.ByID, FQuery.RecordCount); | 
 
 
 
 
 
 
 
 
 
 | 204 | 
 – | 
   if FQuery.RecordCount > 0 then | 
 
 
 
 
 
 
 
 
 
 | 205 | 
 – | 
   begin | 
 
 
 
 
 
 
 
 
 
 | 206 | 
 – | 
     i := 0; | 
 
 
 
 
 
 
 
 
 
 | 207 | 
 – | 
     repeat | 
 
 
 
 
 
 
 
 
 
 | 208 | 
 – | 
       Result.ByID[i].SrcOffset := FQuery.FieldByName('src_link_offset').AsInteger; | 
 
 
 
 
 
 
 
 
 
 | 209 | 
 – | 
       Result.ByID[i].Destination := FQuery.FieldByName('target_id').AsInteger; | 
 
 
 
 
 
 
 
 
 
 | 210 | 
 – | 
       Inc(i); | 
 
 
 
 
 
 
 
 
 
 | 211 | 
 – | 
       FQuery.Next; | 
 
 
 
 
 
 
 
 
 
 | 212 | 
 – | 
     until FQuery.EOF; | 
 
 
 
 
 
 
 
 
 
 | 213 | 
 – | 
   end; | 
 
 
 
 
 
 
 
 
 
 | 214 | 
 – | 
   FQuery.Close; | 
 
 
 
 
 
 
 
 
 
 | 215 | 
 – | 
 end; | 
 
 
 
 
 
 
 
 
 
 | 216 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 201 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 202 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 203 | 
   | 
 function TAccess_OUP_ADB.GetFileInfo(fileid: Integer): TFileInfo; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 215 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 216 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 217 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 218 | 
 + | 
   function CompareItems(List: TStringList; I1, I2: Integer): Integer; | 
 
 
 
 
 
 
 
 
 | 219 | 
 + | 
   var | 
 
 
 
 
 
 
 
 
 | 220 | 
 + | 
     s1, s2: String; | 
 
 
 
 
 
 
 
 
 | 221 | 
 + | 
   begin | 
 
 
 
 
 
 
 
 
 | 222 | 
 + | 
     s1 := MidStr(List[I1], 1, PosEx(';', List[I1], 6) - 1); | 
 
 
 
 
 
 
 
 
 | 223 | 
 + | 
     s2 := MidStr(List[I2], 1, PosEx(';', List[I2], 6) - 1); | 
 
 
 
 
 
 
 
 
 | 224 | 
 + | 
     Result := CompareStr(s1, s2); | 
 
 
 
 
 
 
 
 
 | 225 | 
 + | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 226 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 227 | 
   | 
 function TAccess_OUP_ADB.GetFilesList(ext: String; pattern: String; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 228 | 
   | 
   NoEmptyFiles: Boolean; SortType: TSortType): TStrings; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 263 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 264 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 265 | 
   | 
   list := TStringList.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 | 266 | 
 < | 
   list.Sorted := True; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 266 | 
 > | 
   if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then | 
 
 
 
 
 
 | 267 | 
 > | 
     list.Sorted := False | 
 
 
 
 
 
 | 268 | 
 > | 
   else | 
 
 
 
 
 
 | 269 | 
 > | 
     list.Sorted := True; | 
 
 
 
 
 
 
 
 
 
 
 
 | 270 | 
   | 
   for i := 0 to GetFileCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 271 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 272 | 
   | 
     if ((Length(ext) = 0) or (Pos(Fdat_files[i].Extension, ext) > 0)) and | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 283 | 
   | 
           ST_IDAsc, ST_IDDesc:     list.Add(id + ';' + name + ';' + extension); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 284 | 
   | 
           ST_NameAsc, ST_NameDesc: list.Add(name + ';' + id + ';' + extension); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 285 | 
   | 
           ST_ExtAsc, ST_ExtDesc:   list.Add(extension + ';' + id + ';' + name); | 
 
 
 
 
 
 
 
 
 
 
 
 | 286 | 
 < | 
           ST_ExtNameAsc, ST_ExtNameDesc: list.Add(name + ';' + extension + ';' + id); | 
 
 
 
 
 
 
 
 
 
 | 286 | 
 > | 
           ST_ExtNameAsc, ST_ExtNameDesc: list.Add(extension + ';' + name + ';' + id); | 
 
 
 
 
 
 
 
 
 
 
 
 | 287 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 288 | 
   | 
       end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 289 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 290 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 | 291 | 
 + | 
   if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then | 
 
 
 
 
 
 
 
 
 | 292 | 
 + | 
     list.CustomSort(CompareItems); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 293 | 
   | 
   if not Assigned(Result) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 294 | 
   | 
     Result := TStringList.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 295 | 
   | 
   if list.Count > 0 then |