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
- Code: Select all Expand view
- @ 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
- Code: Select all Expand view
- @ 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 Expand view
- ***************************************************************************************************
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