FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE BUGS?
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE BUGS?
Posted: Wed Dec 03, 2008 02:51 PM

1.) When MARQSTYLE_HIGHLROW, then on a database with many cols, not all cols are shown. The range from the Hscroll are OK and is also show ok! This bug are not, when bClrRowFocus is defined!!

2.) When scrolling the database, the arrow and the key "DOWN" from the vertical scrollbar has no reaction. Thumbpos are right.

3.) Method ToExcel:
When the value from first col is empty, then the value from following cols are beginning on the first col!
Also I get an error on the first call after starting the computer from this method (TOLEAuto():New( "Excel.Application" )).

Any suggestion?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE BUGS?
Posted: Thu Dec 04, 2008 02:17 PM
ANTONIO, please change this code in XBROWSE.

3.) Method ToExcel:
When the value from first col is empty, then the value from following cols are beginning on the first col! Also, if CRLFs in text (M-fields) should converted with strtran to " ; " or an other character!


This could be a way:

METHOD ClpRow( lFullRow ) CLASS TXBrowse

   local nLast := Len( ::aCols )
   local n, RetVal := ""

   DEFAULT lFullRow := ( ::nMarqueeStyle >= 4 )

   if lFullRow
      for n := 1 to nLast
         if ! ::aCols[ n ]:lHide
*            if ! Empty( RetVal )
*               RetVal   += Chr( 9 )
*            endif
            RetVal += strtran(::aCols[ n ]:ClpText,CRLF," ; ") + Chr( 9 ) //changed byte-one
         endif
      next
   else
      RetVal   := strtran(::SelectedCol():ClpText,CRLF," ; ")
   endif

return RetVal


2.) When scrolling the database, the arrow and the key "DOWN" from the vertical scrollbar has no reaction. Thumbpos are right.


The ::bBof and ::bEof should redefined and not in DEFAULT! I define the xbrowse without any datatype and later i will set the datas with setRDD. But in method initiate() this codeblocks set to .T. (also eof and bof is .T.) when no datatype are defined!

METHOD SetRDD() class TXBROWSE
.
.
  DEFAULT ::bGoTop    := {|| ( ::cAlias )->( DbGoTop() ) },;
           ::bGoBottom := {|| ( ::cAlias )->( DbGoBottom() ) },;
           ::bSkip     := {| n | iif( n == nil, n := 1, ), ( ::cAlias )->( DbSkipper( n ) ) },;
           ::bBookMark := {| n | iif( n == nil,;
                                     ( ::cAlias )->( RecNo() ),;
                                     ( ::cAlias )->( DbGoto( n );
                                    ) ) }

          ::bBof      := {|| ( ::cAlias )->( Bof() ) }   //added byte-one
          ::bEof      := {|| ( ::cAlias )->( Eof() ) }   //added byte-one
.
.
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE BUGS?
Posted: Fri Dec 12, 2008 12:02 PM

Antonio, have you seen this points and also my private mail with other things to correcting.

Another issue:
In XBROWSE method toexcel the decimal-point with european "," are only shown, if the value > 1000.
And is it possible, write numeric datatype in oxbrw:toexcel()

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE BUGS?
Posted: Sat Dec 20, 2008 10:20 AM

Antonio, have you seen this points and the mail?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
XBROWSE BUGS?
Posted: Sat Dec 20, 2008 10:27 AM

Günther,

We are going to publish a new xbrowse version in just some days.

Our plan is to include your changes and required fixes into it, plus our own changes and enhancements.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE BUGS?
Posted: Sat Dec 20, 2008 11:22 AM

Thanks Antonio!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 53
Joined: Fri Mar 23, 2007 04:10 AM
Re: XBROWSE BUGS?
Posted: Mon Feb 09, 2009 08:08 PM
Hello Günther,

Antonio may have fixed this by now, but the code correction I made for the ToExcel() problem that happens when the first xBrowse() column is blank is:

METHOD ClpRow( lFullRow ) CLASS TXBrowse

   local nLast := Len( ::aCols )
   local n, RetVal := ""

   DEFAULT lFullRow := ( ::nMarqueeStyle >= 4 )

   if lFullRow
      for n := 1 to nLast
         if ! ::aCols[ n ]:lHide
            RetVal += ::aCols[ n ]:ClpText  // 02/08/09, Patrick Weisser, moved up.
            if n < nLast                    // 02/08/09, Patrick Weisser, changed from: ! Empty( RetVal )
               RetVal += Chr( 9 )
            endif
         endif
      next
   else
      RetVal   := ::SelectedCol():ClpText
   endif

return RetVal


I was also getting a crash when the ToExcel() feature was used on a machine that did not have Excel installed. I'm using plain Harbour (not xHarbour) and there was no Try/Catch sequence for that case. I made the following change in the ToExcel() method:

#ifdef __XHARBOUR__

   TRY
      oExcel   := GetActiveObject( "Excel.Application" )
   CATCH
      TRY
         oExcel   := CreateObject( "Excel.Application" )
      CATCH
         MsgAlert( "Excel not installed" )
         return Self
      END
   END

#else
   TRY

      oExcel   := TOLEAuto():New( "Excel.Application" )

   CATCH

      MsgAlert( "Excel is not installed." )

      Return( NIL )

   END
#endif
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: XBROWSE BUGS?
Posted: Tue Feb 10, 2009 12:12 AM

Hello Patrick,
yes the last chr(9) are not necessary but on the last col anyhow a CRLF is given and the next full line are reading.
And you are not made the strtran() to transform CRLFs to " ; " (Memofields). If not, this makes problems!

The TRY - CATCH is super!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: XBROWSE BUGS?
Posted: Tue Feb 10, 2009 07:48 PM
Patrick,

You can also have TRY ... CATCH in Harbour this way:
#ifndef __XHARBOUR__
   #xcommand TRY      => bError := errorBlock( {|oErr| break( oErr ) } ) ;;
                                 BEGIN SEQUENCE
   #xcommand CATCH [<!oErr!>] => errorBlock( bError ) ;;
                                 RECOVER [USING <oErr>] <-oErr-> ;;
                                 errorBlock( bError )
#endif
static bError
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion