Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
2671 00 JVCL Components major always 2005-02-21 06:43 2005-02-24 07:16
plamendp  
jfudickar  
normal  
resolved  
fixed  
none    
none 3.00  
0002671: JvAppIniFileStorage WriteXXXXX() writes only the last
This code (simple application with one main form and button with
OnClick=JvHTButton1Click) writes to ini file ONLY the LAST item ('test4')

TForm1.JvHTButton1Click(Sender: TObject);
begin
  JvAppIniFileStorage1.DefaultSection := 'TEST';
  JvAppIniFileStorage1.WriteInteger('test1',10);
  JvAppIniFileStorage1.WriteInteger('test2',20);
  JvAppIniFileStorage1.WriteInteger('test3',30);
  JvAppIniFileStorage1.WriteInteger('test4',40);
  JvAppIniFileStorage1.Flush;
end;

JvAppIniFileStorage1 Properties:
AutoFlush=false
AutoReload=false
ReadOnly=false



Some info for you, devs:

Changing AutoFlush to TRUE make things working (?!)

Digging in the source I found that there is a

1. Call to TJvCustomAppStorage.ReloadIfNeeded in TJvCustomAppIniStorage.WriteValue()

=>>> 2. subsequent call to TJvCustomAppMemoryFileStorage.ReloadNeeded
wich checks the property FFileLoaded (and AutoReload).

3. FFileLoaded is set to true only in TJvCustomAppMemoryFileStorage.Reload wich is never called (in this example).

4. THUS: after every WriteXXXX() the file is reloaded (with empty sections, if new file, or old key values, if old), hence only the last WriteXXXX() becomes a REAL/VALID writing. (old key values not changed /reloaded again and again/ or ONLY ONE value added /keys previously written erased because of the reloading an empty section/).



hope this make sence
has duplicate 0002672resolved jfudickar JvAppIniFileStorage WriteXXXXX() writes only the last 
Issue History
2005-02-21 06:43 plamendp New Issue
2005-02-21 23:54 jfudickar Issue Monitored: jfudickar
2005-02-21 23:54 jfudickar Status new => assigned
2005-02-21 23:54 jfudickar Assigned To => jfudickar
2005-02-21 23:54 jfudickar Relationship added has duplicate 0002672
2005-02-23 15:17 jfudickar Note Added: 0006554
2005-02-23 15:19 jfudickar Status assigned => feedback
2005-02-24 05:53 plamendp Note Added: 0006558
2005-02-24 07:16 jfudickar Status feedback => resolved
2005-02-24 07:16 jfudickar Resolution open => fixed

Notes
(0006554)
jfudickar   
2005-02-23 15:17   
Fixed in CVS, please Test it.
(0006558)
plamendp   
2005-02-24 05:53   
TEST succeeded.
Works fine.