xbrowse - SetArray

xbrowse - SetArray

Postby nageswaragunupudi » Sun Dec 30, 2007 9:11 pm

Now, SetArray method resets all columns already defined if any ( ::aCols := {} ). If we use the new command set provided for xbrowse like this :

Code: Select all  Expand view
function xbrindialog( alin )
local odlg, obrw

   define dialog odlg size 640,440 pixel

   @ 10,10 xbrowse obrw ;
      fields str(alin[obrw:narrayat][1],2), ;
             alin[obrw:narrayat][2], ;
             alin[obrw:narrayat][3]  ;
      headers 'cod','description','cd' ;
      size 300,200 pixel of odlg
        // at this stage the columns are arleady defined
   obrw:setarray(alin)  // now setarray erases all the column defs

   obrw:createfromcode()
   activate dialog odlg centered

   return nil

If the following change is made in SetArray method to automatically define the columns only if the columns are not already defined, the above code works as expected. The suggested change is
Code: Select all  Expand view
if empty( ::acols )  // NEW
    ::aCols := {}
    for nFor := 1 to len( aData[ 1 ] )
         < ........... code ......... >
   next
endif  // NEW

With this change the above code works well
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests