Changeset 209 for oup/current/DataAccess
- Timestamp:
- Jun 5, 2007, 12:07:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
oup/current/DataAccess/Access_OniArchive.pas
r192 r209 16 16 FRawOpened: Boolean; 17 17 FSepOpened: Boolean; 18 procedure SetUnloadWhenUnused(doit: Boolean); 18 19 protected 19 20 public 20 property UnloadWhenUnused: Boolean Read FUnloadWhenUnused Write FUnloadWhenUnused;21 property UnloadWhenUnused: Boolean Read FUnloadWhenUnused Write SetUnloadWhenUnused; 21 22 22 23 constructor Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages); override; … … 161 162 FChangeRights := [CR_EditDat, CR_EditRaw, CR_AppendRaw]; 162 163 end; 164 165 166 167 168 procedure TAccess_OniArchive.SetUnloadWhenUnused(doit: Boolean); 169 begin 170 FUnloadWhenUnused := doit; 171 if FUnloadWhenUnused then 172 begin 173 if FDatOpened then 174 begin 175 FDatOpened := False; 176 Fdat_file.Free; 177 end; 178 if FRawOpened then 179 begin 180 FRawOpened := False; 181 Fraw_file.Free; 182 end; 183 if FSepOpened then 184 begin 185 FSepOpened := False; 186 Fsep_file.Free; 187 end; 188 end 189 else 190 begin 191 if not FDatOpened then 192 begin 193 Fdat_file := TFileStream.Create(FFileName, fmOpenReadWrite); 194 FDatOpened := True; 195 end; 196 if not FRawOpened then 197 begin 198 Fraw_file := TFileStream.Create(AnsiReplaceStr(FFileName, '.dat', '.raw'), 199 fmOpenReadWrite); 200 FRawOpened := True; 201 end; 202 if (not FSepOpened) and (FDataOS <> DOS_WIN) then 203 begin 204 Fsep_file := TFileStream.Create(AnsiReplaceStr(FFileName, '.dat', '.sep'), 205 fmOpenReadWrite); 206 FSepOpened := True; 207 end; 208 end; 209 end; 210 163 211 164 212
Note:
See TracChangeset
for help on using the changeset viewer.