Public oForm >oForm = Createobject('sampleForm') >oForm.Show() > >Define Class sampleForm As Form > DataSession = 2 > Add Object myGrid As Grid With RecordSource='Customer' > > Procedure Load > Use (_samples+'data\customer') > Endproc > > Procedure Init > Local lcValue, DynBC > This.myGrid.Tag = "a" + Replicate(".", 1023) + "z" > *** this line is modified > DynBC = '(IIF(LEN("' + this.mygrid.Tag + '") > 1024 and RIGHT("' + this.mygrid.Tag + '",1)="z", 0xFFFF00, RGB(0,0,0)))' > > This.myGrid.SetAll('DynamicBackColor',m.DynBC) > > Messagebox(This.myGrid.Columns(1).DynamicBackColor) > Messagebox(This.myGrid.Tag) > Messagebox(Len(This.myGrid.Tag)) > Endproc >Enddefine>
Public oForm, cDynBC >oForm = Createobject('sampleForm') >oForm.Show() > >Define Class sampleForm As Form > DataSession = 2 > Add Object myGrid As Grid With RecordSource='Customer' > > Procedure Load > Use (_samples+'data\customer') > Endproc > > Procedure Init > Local lcValue, DynBC > This.myGrid.Tag = "a" + Replicate(".", 254) + "z" > DynBC = '(IIF(RIGHT("' + "a" + Replicate(".", 254) + "z" + '",1)="z", RGB(0,0,0), 0xFFFF00))' > > This.myGrid.SetAll('DynamicBackColor',m.DynBC) > Endproc >EnddefineYou are intentionally creating expressions that goes beyond VFP's string literal limit 255. VFP doesn't protect you from intentional errors and if that is in Dynamic*Color expression, rather than showing up error silently doesn't apply the dynamic coloring.