FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bug xBrowse()
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
bug xBrowse()
Posted: Sun Dec 28, 2014 11:45 AM

Hello,

In previous builds, issuing xBrowse(oObject), when the object was empty showed an empty xbrowse(), but now it shows the current dbf.

It should show an empty xbrowse or a message saying that oObject is empty.

Thank you.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bug xBrowse()
Posted: Sun Dec 28, 2014 02:01 PM

Moises,

That behavior has not changed since 2013 or even earlier.

To me it is not wrong, as it is using the default Alias().

Why don't you close the DBF before calling Xbrowse( oObject ) ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug xBrowse()
Posted: Sun Dec 28, 2014 03:16 PM

Antonio,

Several times, I use xBrowse( oObject ) to do debugging, not for browsing the table.

For browsing the table, I do xbrowse() or xbrowse( alias() ).

In the past, when oObject was empty or nill, xBrowse showed empty. That was great.

Now, when the Object passed in the function is not empty, it browses it. Otherwise, this is the problem, now browses the dbf, not an empty object as in the past.

I am sure there is a bug. Maybe Mr. Nages could confirm it?.

Thank you.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: bug xBrowse()
Posted: Sun Dec 28, 2014 05:27 PM
Moises,

It does not seem as a bug, see this:

Code (fw): Select all Collapse
function XBrowse( uData, cTitle, lAutoSort, bSetUp, aCols, bSelect, lExcel, lFastEdit, ;
                  bValid, cSerial )

   ...

   DEFAULT  uData    := Alias()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug xBrowse()
Posted: Sun Dec 28, 2014 07:11 PM
Antonio,

Please, try:

Code (fw): Select all Collapse
function main()

  local myvar := {}

  use testing

  xbrowse( myvar )

return nil



The xBrowse shows an empty array.


And next:

Code (fw): Select all Collapse
function main()

  local myvar 

  use testing

  xbrowse( myvar )

return nil


This is the problem.

Thank you.
Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: bug xBrowse()
Posted: Mon Dec 29, 2014 03:37 AM

Mr Antonio is correct. When uData is nil, xbrowse displays default Alias(). This has been the behavior since the time this function was created and this behavior is intentional.

We intended that simple statement
XBrowse() or
XBROWSER
shows the default alias, same way the function Browse() does. ( Browse() uses WBrowse )

When there is no DBF open yet then this function shows an empty browse.

You can use (0)->( XBrowse( MyVar ) ) to get what you want.

Regards



G. N. Rao.

Hyderabad, India
Posts: 838
Joined: Wed Aug 22, 2007 10:09 AM
Re: bug xBrowse()
Posted: Tue Dec 30, 2014 10:31 AM

Thank you for your clarifications.

I guess in the past I modified in the lib xbrowse() removing default cAlias := alias().

For my purpouses, I created a personal UDF.

Saludos / Regards,



FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40

Continue the discussion