Hi Martin,

   Now the code is clearer. Thanks for this  guide

   Now Inside OnstatRead event I did    ReadW ( read)  and In OnStatWrite event 
 ReadW(write)

   proc ReadW  (const filer :tstatfiler)
  
later
       with tstatfiler(filer) do if isWrite then writeBoolean( var) else var:= 
readboolean()   
     
Best Regards

Med________________________________________
De : Martin Schreiber [mse00...@gmail.com]
Envoyé : mercredi 12 octobre 2016 12:38
À : mseide-msegui-talk@lists.sourceforge.net
Objet : Re: [MSEide-MSEgui-talk] statfile

On Wednesday 12 October 2016 14:12:53 mohamed hamza wrote:
> Hi martin,
>
>     I think it's  better to have an onStateRead and onStateWrite events
> like this  onStateRw(....;const lrw:boolean)
>
>    and then we can write if lrw then var := reader.readboolean(...) else
> writer.writeboolean( ....;var)
>
>     I would not order you something. I just want to know your point of
> view.
>
There is TStatFile.OnStatUpdate and TStatFiler.IsWriter.
I didn't want to recommend OnStatUpdate because TWidget.Enabled is a property
and can not be used in TStatFiler.UdateValue().
And OnStatRead and OnStatWrite have different parameters:
"
 statreadeventty = procedure(const sender: tobject;
                                  const reader: tstatreader) of object;
 statwriteeventty = procedure(const sender: tobject;
                                  const writer: tstatwriter) of object;
"
OnStatUpdate is:
"
 statupdateeventty = procedure(const sender: tobject;
                                  const filer: tstatfiler) of object;
"
In your example OnStatUpdate can be used as:
"
 filer.updatevalue('thename',thevariable);
"

>      nb: Sometimes  we have several instructions before readboolean or
> writeboolean.
>
I don't understand.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to