Hello Med. Once again, not sure to understand but you can play with something like this:
type aSumty = ( Price, Amount, Color); type aSumaty = array [aSumty] of msestring; const aSum: aSumaty = ( 'Price', 'Amount', 'Color'); ---------- And use it something like this: ... then sumField( aSum[oCustEdit], n); ________________________________ De : mohamed hamza <medh...@hotmail.com> Envoyé : jeudi 3 août 2023 17:46 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net> Objet : Re: [MSEide-MSEgui-talk] INITIALIZATION SECTION Hello Fred, Thanks to help. I want to ask if it's possible change array to set of ... In my case , replacing : var frmInfotiersfo: tfrmInfotiersfo; aR1:array[1..2] of tcustomdataedit; oCustEdit:tcustomDataEdit; with const aSum set of tcustomdataedit = [ Price, Amount .....] and then I can do if oCustEdit in aSum then sumField( aSum[?], n); Med ________________________________ De : Fred vS <fi...@hotmail.com> Envoyé : samedi 29 juillet 2023 15:02 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net> Objet : Re: [MSEide-MSEgui-talk] INITIALIZATION SECTION Re-hello Med. If suggestion in previous post is not working or irrelevant, maybe it is because at initialization the frmInfotiersfo was not yet created. In this case maybe better to do the initialization in a method of frmInfotiersfo.oncreated(). Fre;D ________________________________ De : mohamed hamza <medh...@hotmail.com> Envoyé : samedi 29 juillet 2023 10:41 À : General list for MSEide+MSEgui <mseide-msegui-talk@lists.sourceforge.net> Objet : [MSEide-MSEgui-talk] INITIALIZATION SECTION Hello , I am wondering why object of a tform is not visible to initialisation section? The folowing piece of code gives an error ? type tfrmInfotiersfo = class(tfrmbasePagefo) tdbwidgetgrid1: tdbwidgetgrid; tdbdatetimeedit1: tdbdatetimeedit; tdbintegeredit1: tdbintegeredit; .... .... var frmInfotiersfo: tfrmInfotiersfo; aR1:array[1..2] of tcustomdataedit; initialisation begin ar1[1]:=(tdbintegeredit1); end; end. I got the error frmInfotiers.pas(134,23) Error: Identifier not found "tdbintegeredit1" ? why tdbintegeredit1 is not visible to the init section Best Regards. Med
_______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk