FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TGet with latest xHarbour from CVS
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TGet with latest xHarbour from CVS
Posted: Mon Jan 15, 2007 04:50 PM
This is the sample. Try pressing a digit and you will get the separator dots on the GET.

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL nVar := 0

    DEFINE DIALOG oDlg

    @ 0, 0 GET nVar;
           PICTURE "@EZ 999,999.99";
           RIGHT

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in TGet with latest xHarbour from CVS
Posted: Mon Jan 15, 2007 10:24 PM
It is a bug in xHarbour's GET class:

FUNCTION MAIN()

    LOCAL GetList := {}

    LOCAL nVar1 := 0
    LOCAL nVar2 := 0

    CLS

    @ 10, 10 GET nVar1;
             PICTURE "@EZ 999,999.99";
             WHEN ( GetList[ 1 ]:Picture := "@EZ  999999.99", .T. );
             VALID ( GetList[ 1 ]:Picture := "@EZ 999,999.99", .T. )

    @ 12, 10 GET nVar2;
             PICTURE "@EZ 999,999.99"

    READ

    RETURN NIL


Already reported to xHarbour developers list.

EMG
Posts: 107
Joined: Tue Apr 11, 2006 04:36 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 16, 2007 12:45 AM

Enrico, this is after or before this entry:

2007-01-07 16:45 UTC-0300 Eduardo Fernandes <modalsist@yahoo.com.br>
258 * source/rtl/tget.prg
259 ! fixed parsepict() method to avoid replacing commas by spaces, in
260 pictures like @Z 99,999.99.
261 Adjusted get len for negative numbers, when not exist picture on get.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 16, 2007 03:00 AM

Enrico,

> Already reported to xHarbour developers list.

Thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 16, 2007 07:52 AM
Nop wrote:Enrico, this is after or before this entry:

2007-01-07 16:45 UTC-0300 Eduardo Fernandes <modalsist@yahoo.com.br>
258 * source/rtl/tget.prg
259 ! fixed parsepict() method to avoid replacing commas by spaces, in
260 pictures like @Z 99,999.99.
261 Adjusted get len for negative numbers, when not exist picture on get.


Thank you.

EMG
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Bug in TGet with latest xHarbour from CVS
Posted: Sat Jan 27, 2007 06:53 AM

Enrico,

I have a problem when pressing . to enter numbers to the right of the decimal and the original number to the left of the decimal is not cleared.

For example, I have a number 123.45. If I press .67 the 123 remains and the .67 is entered over the .45. The old behaviour was to clear the all the digits to the left of the decimal so that the result was only 0.67.

Do you get the same behaviour? I'm using PICTURE "9999.99". It seems to be a problem with latest xHarbour Jan 07 and FWH.

Thanks,
Randal Ferguson

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TGet with latest xHarbour from CVS
Posted: Sat Jan 27, 2007 12:41 PM

Please show a self-contained sample of the problem.

EMG

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Bug in TGet with latest xHarbour from CVS
Posted: Sat Jan 27, 2007 03:34 PM

Enrico,

Thanks for the reply. I was simply compiling a small FWH sample to test. This sample works when compiled with FWH and xBuilder Mar06 but with xBuilder Oct 06 and Jan 07 I get the behaviour I described.

Thanks,
Randal Ferguson

// Testing GETs

include "FiveWin.ch"

function Main()
LOCAL oDlg, oGet
LOCAL cCad := "Testing " // pad("Testing Gets",40)
LOCAL nNum := 0
LOCAL dDat := "Test 2"

Set century On
Set Date Ansi
Set Date format "mm/dd/yyyy"

SET _3DLOOK ON

msginfo("testget")

DEFINE DIALOG oDlg TITLE "TGet from " + FWDESCRIPTION
@ 1, 2 SAY "Text..:" OF oDlg
@ 1, 6 GET oGet VAR cCad OF oDlg SIZE 60, 10 // COLOR "W/G"
@ 1.8, 2 SAY "Number:" OF oDlg
@ 2, 6 GET oGet VAR nNum OF oDlg SIZE 60, 10 PICTURE "9999999.99"
@ 2.6, 2 SAY "Date:" OF oDlg
@ 3, 6 GET oGet VAR dDat OF oDlg SIZE 60, 10 // WHEN .f. // "@D"
oGet:lDisColors = .f. // don't use standard disabled colors
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL

ACTIVATE DIALOG oDlg CENTERED ;
VALID MsgYesNo( "Want to end ?" )

return nil

//------------------------------------------------------------------------//

procedure appsys
return

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TGet with latest xHarbour from CVS
Posted: Sat Jan 27, 2007 04:27 PM
Confirmed. Just reported to the xHarbour developers list with the following sample:

#include "Inkey.ch"


FUNCTION MAIN()

    LOCAL GetList := {}

    LOCAL nVar := 123.45

    SETKEY( K_F2, { || GetList[ 1 ]:ToDecPos() } )

    CLS

    @ 10, 10 GET nVar;
             PICTURE "@E 999.99"

    READ

    RETURN NIL


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TGet with latest xHarbour from CVS
Posted: Sat Jan 27, 2007 05:06 PM

Enrico,

Thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
Bug in TGet with latest xHarbour from CVS
Posted: Sat Jan 27, 2007 07:02 PM

Enrico,

Thanks alot! I really appreciate you taking the time to look at this.

Best Regards,
Randal Ferguson

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 30, 2007 10:59 AM
The bug has been fixed but the result is not what you expected. Now the xHarbour GET class behavior is Clipper compatible but you have to change FWH TGet class to get the same behavior:

if ::oGet:Type == "N" .and. ;
   ( Chr( nKey ) == "." .or. Chr( nKey ) == "," )
   if ::oGet:Clear   // EMG
      ::oGet:DelEnd()   // EMG
   endif   // EMG
   ::oGet:ToDecPos()
else


EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 30, 2007 11:28 AM

Enrico,

Does your change work fine with Harbour too ? thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 30, 2007 12:00 PM
Antonio Linares wrote:Enrico,

Does your change work fine with Harbour too ? thanks


Yes, it seems so.

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TGet with latest xHarbour from CVS
Posted: Tue Jan 30, 2007 12:03 PM

Thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com