FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TXBROWSE LINE NUMBER?
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
TXBROWSE LINE NUMBER?
Posted: Fri Nov 13, 2009 03:40 PM

Hi,

How can I add a line number column in TXBrowse. (Not. recno())

Thanks,

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: TXBROWSE LINE NUMBER?
Posted: Fri Nov 13, 2009 05:00 PM

Hello Hakan,
You can add a Column to get Row-Numbers like :

oCol := oLbx:AddCol()
oCol:cHeader := "No."
oCol:bStrData := { || (1)->(ORDKEYNO()) }
oCol:nWidth := 60

Best Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: TXBROWSE LINE NUMBER?
Posted: Fri Nov 13, 2009 05:34 PM
The above example works only for DBFs.

The example given below works for XBrowse of any data ( DBF, ADO, TDataBase, Array or any object being browsed )
Code (fw): Select all Collapse
   ADD TO oBrw AT 1 DATA oBrw:KeyNo() HEADER 'No' PICTURE '9999'


If you prefer the OOPs way of coding
Code (fw): Select all Collapse
   WITH OBJECT oBrw:InsCol( 1 )
      :bEditValue    := { || oBrw:KeyNo() }
      :cEditPicture  := '9999'
      :cHeader       := 'LineNo'
   END

FWH documentation advises not to use :bStrData directly ( though it works for reasons of backward compatibility). Preferred way is to assign the :bEditValue and assign picture if needed to cEditPicture.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TXBROWSE LINE NUMBER?
Posted: Fri Nov 13, 2009 09:07 PM

Thanks Uwe, nageswaragunupudi

It works fine.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion