We need your input on how to migrate FoxPro forms
Posted: Fri Jan 10, 2020 5:09 am
In addition to what others said about this, thisform, this.parent, we also use WITH ... ENDWITH. For instance, this is how I set up one of my grids. These codes are on the Grid's Init event:
That made it more readable for me than a lot of reference to the same object (This):
and so on....
Code: Select all
With This
.RecordSourceType= 1
.RecordSource='vwADSB'
.column1.ControlSource='vwADSB.refno'
.column2.ControlSource='vwADSB.revision'
.column3.ControlSource='vwADSB.modno'
.column4.ControlSource='vwADSB.description'
.column5.ControlSource='vwADSB.issued'
.column6.ControlSource='vwADSB.adstatus'
.column7.ControlSource='vwADSB.repetitive'
.column8.ControlSource='vwADSB.compdue'
.column9.ControlSource='vwADSB.hrs'
.column10.ControlSource='vwADSB.hrsdate'
.column11.ControlSource='vwADSB.comprefno'
.column12.ControlSource='vwADSB.adsched'
.column13.ControlSource='vwADSB.tagged'
.column14.ControlSource='vwADSB.origin'
.column15.ControlSource='vwADSB.lbk'
.column13.DynamicCurrentControl = 'IIF(vwadsb.tagged=1,"imgChk","imgnochk")'
.SetAll('Alignment',2,'Header')
.SetAll('DynamicBackColor','ICASE(ALLTRIM(vwadsb.description) = "CANCELLED",RGB(255,179,179),'+;
'INLIST(ALLTRIM(vwadsb.adstatus),"FE","E") AND ALLTRIM(vwadsb.repetitive) = "YES",RGB(0,190,0),'+;
'INLIST(ALLTRIM(vwadsb.adstatus),"FE","E") AND ALLTRIM(vwadsb.repetitive) = "NO",RGB(183,255,183),'+;
'RGB(255,255,255))','Column')
.RowHeight= gomyapp.RowHeight
ENDWITH
That made it more readable for me than a lot of reference to the same object (This):
Code: Select all
This.RecordSourceType= 1
This.RecordSource='vwADSB'
This.column1.ControlSource='vwADSB.refno'
This.column2.ControlSource='vwADSB.revision'