Page 1 of 1

DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 2:10 am
by PedroAlex
Hi Roger,
My problema is :

Yesterday I compiled some applications with eXpress 267 and XB 2.01113
and there was a wrong operation in DCay get and combo over a dctabpage.

This code runs OK with eXpress 264 and XB 2.01113.

Code: Select all

//----------------------------------------------
FUNCTION Teste_ListBox()
LOCAL GetList[0], GetOptions, aSimNao := { { 'Sim',1 }, { 'Não',2 }, { 'Off',3 } } //, cCampo1:='S', cCampo2:='S', cCampo3:='S'

DbUseArea( .t., 'FOXCDX', 'ARTMES.DBF', 'ARTIGOS', .t., .f. )
ARTIGOS->( DbGoTop() )

Do while .t.

            IF ARTIGOS->( DbRLock() )

                        @ 0,0 DcTabpage TABPAGE1 Caption '1' size 85,23 preoffset 0 postoffset 87  FONT '10.Arial Bold'

                        @  1.5,1  dcgroup POS caption 'Configuração POS' size 40,20 parent TABPAGE1 COLOR NIL,0

                        @  2,01 dcsay ' Teste 1' get ARTIGOS->UNIDCOMP GETSIZE 4,1 SAYRIGHT Parent POS ;
                        COMBO HEIGHT 3 WIDTH 8                     ;
                        DATA aSimNao ELEMENT 1                     ;
                        RETURN {|n|aSimNao[n,2]}                   ;
                        LISTFONT '9.Courier Bold'

                        @  4,01 dcsay ' Teste 2' get ARTIGOS->UNIDVEND sayright GETSIZE 4,1 Parent POS                       ;
                        COMBO HEIGHT 3 WIDTH 8                     ;
                        DATA aSimNao ELEMENT 1                     ;
                        RETURN {|n|aSimNao[n,2]}                   ;
                        LISTFONT '9.Courier Bold'                  ;

                        @  6,01 dcsay ' Teste 3' get ARTIGOS->IVACOMPRAS sayright GETSIZE 4,1  Parent POS ;
                        COMBO HEIGHT 3 WIDTH 8                     ;
                        DATA aSimNao ELEMENT 1                     ;
                        RETURN {|n|aSimNao[n,2]}                   ;
                        LISTFONT '9.Courier Bold'                  ;

                        @  8,01 dcsay ' Teste 3' get ARTIGOS->UNIDADE  sayright picture "!!!!!"  Parent POS ;
                        COMBO HEIGHT 3 WIDTH 8                     ;
                        DATA aSimNao ELEMENT 1                     ;
                        RETURN {|n|aSimNao[n,1]}                   ;
                        LISTFONT '9.Courier Bold'                  ;

                        @ 10,01 dcsay ' Teste 3' get ARTIGOS->UNIDADE2  sayright picture "!!!!!"  Parent POS ;
                        COMBO HEIGHT 3 WIDTH 8                     ;
                        DATA aSimNao ELEMENT 1                     ;
                        RETURN {|n|aSimNao[n,1]}                   ;
                        LISTFONT '9.Courier Bold'                  ;

                        DCGETOPTIONS SAYFONT '10.Arial Bold' NOMAXBUTTON NOMINBUTTON BUTTONALIGN DCGUI_BUTTONALIGN_CENTER NORESIZE

                        DCREAD GUI ;
                        TITLE 'Testar ListBox' ;
                        FIT ;
                        OPTIONS GetOptions ;
                        ADDBUTTONS

                        ARTIGOS->( DbRUnLock() )
                        Exit

            Endif

Enddo

Close ARTIGOS

RETURN nil

If I change this :
RETURN {|n|aSimNao[n,1]}

to this
RETURN {|n|ARTIGOS->UNIDADE2 := aSimNao[n,1]}

It works fine but this represente a lot of changes in alll my code.
I think there will be a more effective solution :-)

Many thanks
Best regards

Re: DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 5:58 am
by PedroAlex
Roger,

This error occurs with any get in all situations.
Gets are directly over file fields

Attached sample program

Re: DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 10:35 am
by rdonnay
Are you sure that you are using build 264?

If so, then you cannot use DC_XbpGetSetInputFocusBlock().
That was added in build 265.

You need to tell me what error you are getting.

Re: DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 11:39 am
by PedroAlex
Roger,

See this vídeo..

This happen on Win 10 and Win 7.

I´m using eXpress Build 267 and xBase 2.0.1113.

This problem happen only on edit File field.
On MemVar get run ok.

Re: DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 12:48 pm
by rdonnay
It appears that the most current version of Xbase++ is not allowing the Alias to be used in the GET.

eXpress++ builds a Get-Set code block using DC_GetAnchorCB() and now it is no longer working.

If you remove the Alias then it works ok.

Add this at the beginning of your program:

Code: Select all

DC_AutoLockEditedRecord(.f.) 

Re: DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 3:24 pm
by PedroAlex
Roger,

This solution solve this problem.
DC_AutoLockEditedRecord(.f.) at the begin of programs

I find this change very strange.
What more surprises of this kind can I find?

Anyway thank you very much for the security it gives us.

best regards.

Re: DcSay get on DcTabPage wrong operation

Posted: Fri Jan 10, 2020 4:25 pm
by rdonnay
What more surprises of this kind can I find?
The year 2020 may bring many surprises.