Changeset 8 for trunk/UCore.pas
- Timestamp:
- Feb 1, 2018, 12:51:32 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r3 r8 82 82 SAppExit = 'Application exit'; 83 83 SAppExitQuery = 'File was modified. Do you want to save it before exit?'; 84 SFileNotFound = 'File ''%s'' not found.'; 84 85 85 86 { TCore } … … 188 189 procedure TCore.DataModuleDestroy(Sender: TObject); 189 190 begin 191 FileClose; 190 192 SaveConfig; 191 193 end; … … 204 206 procedure TCore.FileOpen(FileName: string); 205 207 begin 206 FileClose; 207 if FileClosed then begin 208 FileNew; 209 DataFile.LoadFromFile(FileName); 210 LastOpenedList1.AddItem(FileName); 211 end; 208 if FileExists(FileName) then begin 209 FileClose; 210 if FileClosed then begin 211 FileNew; 212 DataFile.LoadFromFile(FileName); 213 LastOpenedList1.AddItem(FileName); 214 end; 215 end else ShowMessage(Format(SFileNotFound, [FileName])); 212 216 end; 213 217 … … 232 236 end else DoClose := True; 233 237 if DoClose then begin 234 FreeAndNil(DataFile);238 if Assigned(DataFile) then FreeAndNil(DataFile); 235 239 FileClosed := True; 236 240 end;
Note:
See TracChangeset
for help on using the changeset viewer.