Page 1 of 1

Mr. Rao. xBrowse bug? (SOLVED)

Posted: Fri Feb 19, 2021 11:16 pm
by ctoas
Mr. Rao

In my previous post, you said that the way I built xBrowse was inadequate. Could you explain that?

The way you suggested it doesn't work properly, but the way I used it does it correctly.

See codes and equivalent images.

So it doesn't work

Image

Code: Select all

@ 0069,0000 XBROWSE oBrwLOTES OF oDlgLOTES SIZE 0520,0230 STYLE FLAT PIXEL NOBORDER DATASOURCE oRsLOTES ;
        COLUMNS PEGANOMELOTEAMENTO(oRsLOTES:loteamento,@cNOMELOTEAMENTO),"quadra","lote","rua" ;
        HEADERS "Loteamento","Quadra","Lote","Rua" ;
        COLSIZES 0455,0065,0045,0455 ;
           PICTURES "@!","99","999","@!"   
So it works

Image

Code: Select all

       @ 0069,0000 XBROWSE oBrwLOTES OF oDlgLOTES SIZE 0520,0230 STYLE FLAT PIXEL NOBORDER DATASOURCE oRsLOTES
            
        ADD TO oBrwLOTES DATA PEGANOMELOTEAMENTO(oRsLOTES:loteamento,@cNOMELOTEAMENTO) PICTURE "@!" HEADER "Loteamento" SIZE 0455
        ADD TO oBrwLOTES DATA oRsLOTES:quadra                                          PICTURE "@!" HEADER "99"        SIZE 0065
        ADD TO oBrwLOTES DATA oRsLOTES:lote                                            PICTURE "@!" HEADER "999"        SIZE 0045
        ADD TO oBrwLOTES DATA oRsLOTES:rua                                             PICTURE "@!" HEADER "Rua"        SIZE 0455 
I would like to understand why one way works and the other not even being the same despite an inadequate one.

Code: Select all

***************************************************************************************************
STATIC FUNCTION PEGANOMELOTEAMENTO(cLOTEAMENTO,cNOMELOTEAMENTO)
***************************************************************************************************
    
    IF oRsLOTEAMENTOS:Seek(cLOTEAMENTO) 
    cNOMELOTEAMENTO := STRZERO(cLOTEAMENTO,3) + " - " + ALLTRIM(oRsLOTEAMENTOS:nome)
    ELSE
        cNOMELOTEAMENTO := "Loteamento não encontrado"
    ENDIF

RETURN cNOMELOTEAMENTO

Re: Mr. Rao. xBrowse bug?

Posted: Sat Feb 20, 2021 3:08 am
by nageswaragunupudi

Code: Select all

        COLUMNS { || PEGANOMELOTEAMENTO(oRsLOTES:loteamento,@cNOMELOTEAMENTO) },"quadra","lote","rua" ;
 

Re: Mr. Rao. xBrowse bug?

Posted: Sat Feb 20, 2021 4:48 pm
by ctoas
I hadn't thought of a code block.

Thanks.