FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour using xbrowse bEditWhen
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
using xbrowse bEditWhen
Posted: Tue Oct 18, 2011 02:36 PM

Hi all,
having the following array

aArray:={}
aadd(aArray,{"Mark"," "})
aadd(aArray,{"Steve,"0"})
aadd(aArray,{"Robert",1"})

I want to permit the edit for the second column only if a numeric already value exist so in this case I can permit only to edit the Steve and Robert clause where a num value exit.

I tried to use the following code but the bEditWhen doesn't run.

    oBrw425:aCols[2]:cEditPicture := "@E 999,999,999.00"
    oBrw425:aCols[2]:bClrEdit     := oBrw425:bClrStd
    oBrw425:aCols[2]:nEditType    := 1
    oBrw425:aCols[2]:bEditWhen    := {|o,x| valtype(o)="N"}
    oBrw425:lFastEdit:=.t.

Probably my bEditWhen code is wrong. any ideas?
Thanks in advance

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 55
Joined: Fri Jul 08, 2011 06:43 AM
Re: using xbrowse bEditWhen
Posted: Tue Oct 18, 2011 02:47 PM

oBrw425:aCols[2]:bEditWhen := {|o,x| valtype(o)="N"}

The first parameter (o) is a column object , valtype(o) should always be 'O'

Frank

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: using xbrowse bEditWhen
Posted: Wed Oct 19, 2011 06:44 AM

Please try
oBrw425:aCols[2]:bEditWhen := {|o,x| valtype(o:Value)="N"}

Regards



G. N. Rao.

Hyderabad, India
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: using xbrowse bEditWhen
Posted: Wed Oct 19, 2011 07:07 PM

That's fine. Thank you Rao

Best Regards,



Marco Turco

SOFTWARE XP LLP

Continue the discussion