Page 1 of 1

error on xbrowse with array empty or error on declare an arr

PostPosted: Mon Aug 27, 2018 2:45 pm
by Silvio.Falconi
I can have an array empty but the xbrowse give me error when I try to show it

aErroriNum:={}


this test give me error on this row

oBrowse1:aCols[2]:cHeader := i18n("Riga")

why ?




Code: Select all  Expand view


Function Controllo()
   Local aErroriNum:={}
   Local oDlgErrore
   Local oBrowse1

 DEFINE DIALOG oDlgErrore  SIZE 600,400  TRANSPARENT;
              TITLE "Configurazione Errata"

@ 30, 10 XBROWSE  oBrowse1 OF oDlgErrore ;
      SIZE 80,100 PIXEL NOBORDER

        oBrowse1:SetArray(aErroriNum)


      oBrowse1:aCols[1]:cHeader  := i18n("Col")
      oBrowse1:aCols[1]:nWidth   := 50
      oBrowse1:aCols[2]:cHeader  := i18n("Riga")
      oBrowse1:aCols[2]:nWidth   := 50

                     WITH OBJECT oBrowse1
                      :lHscroll            := .F.
                      :l2007               := .F.
                      :l2015               := .T.
                      :nStretchCol         := STRETCHCOL_WIDEST
                      :lAllowRowSizing     := .F.
                      :lAllowColSwapping   := .F.
                      :lAllowColHiding     := .F.
                      :lRecordSelector     := .F.
                      :CreateFromCode()
                   END

ACTIVATE DIALOG oDlgErrore CENTERED
return nil



I understood the array aErroriNum can be of one column and my test is bad but How correct it ?
I tried also with aErrorNum:)array(,) but it make error


I tried also with

@ 30, 10 XBROWSE oBrowse1 OF oDlgErrore ;
COLUMNS 1, 2 ;
HEADERS "Col","Riga" ;
COLSIZES 40, 40 ;
ARRAY aErroriNum ;
SIZE 80,100 PIXEL NOBORDER

it not make error but insert on header A B

Re: error on xbrowse with array empty or error on declare an arr

PostPosted: Mon Aug 27, 2018 3:37 pm
by nageswaragunupudi
@ 30, 10 XBROWSE oBrowse1 OF oDlgErrore ;
COLUMNS 1, 2 ;
HEADERS "Col","Riga" ;
COLSIZES 40, 40 ;
ARRAY aErroriNum ;
SIZE 80,100 PIXEL NOBORDER


This is the right way.

it not make error but insert on header A B

I do not understand what does this mean.
Please explain what is the problem.

Re: error on xbrowse with array empty or error on declare an arr

PostPosted: Mon Aug 27, 2018 3:59 pm
by Silvio.Falconi
sorry my mistake
now it seem to run ok




but also I have problem at this topic
viewtopic.php?f=3&t=35980#p214315