Dale
I use Hernan's twbrowse and use in line data entry - with
validation on each cell if required.
oLbx5:bKeyChar := {|nKey| iif(nKey == VK_RETURN,EditLab(oLbx5:nColAct,oLbx5,oTmsht,oLbx1,oTmsht:keyno()),)}
oLbx5:lCellStyle = TRUE
oLbx5:lAutoEdit = TRUE
oLbx5:lAutoSkip = TRUE
static function EditLab(nCol,oLbx5,oTmsht,oLbx1,nRow)
local nNrml := oTmsht:chrg_nml,nTmHlf := oTmsht:chrg_ot,nDble := oTmsht:chrg_dbl
if nCol == 1
oLbx5:lEditCol(nCol,@nNrml,'99.99',,CLR_WHITE,CLR_RED,,)
oTmsht:chrg_nml := nNrml
oTmsht:save()
endif
if nCol == 2
oLbx5:lEditCol(nCol,@nTmHlf,'99.99',,CLR_WHITE,CLR_RED,,)
oTmsht:chrg_ot := nTmHlf
oTmsht:save()
endif
if nCol == 3
oLbx5:lEditCol(nCol,@nDble,'9999.99',,CLR_WHITE,CLR_RED,,)
oTmsht:chrg_dbl := nDble
oTmsht:save()
endif
oLbx5:Refresh()
oLbx5:SetFocus()
return(nil)
To do a validation just use a codeblock
oLbx4:lEditCol(nCol,@nQty,'9999.99',{|| if(!empty(cGroup),nQty := ChkQty(nQty,nStock,oInvItems,nOldQty,aChange),),TRUE} ,CLR_YELLOW,CLR_BLUE,,)
Colin