Using an Array for xBrowse Header

Using an Array for xBrowse Header

Postby Rick Lipkin » Tue Feb 14, 2017 5:23 pm

To All

I have created 2 arrays, one for Data ( aData ) and one for Headers ( aHeader ) .. When I plug the arrays into xBrowse I get the Data but the Headers are A B C D E instead of my aHeader array ...

What am I doing wrong ?

Rick Lipkin
Code: Select all  Expand view

AADD( aHeader,{"Vnumber","License","Cur_Mil","NextService","Serv_Due" } )
AADD( aData, {"01001","SG12345","10000","12/03/2016","10000"} )


DEFINE ICON oIco RESOURCE "AKEY"
DEFINE WINDOW oWNDCHILD MDICHILD      ;
       FROM 1,1 to 35,125             ;
       of oWNDMDI                     ;
       NOZOOM                         ;
       NOMINIMIZE                     ;
       ICON oIco                      ;
       TITLE cTitle

   DEFINE DIALOG oEMP RESOURCE "RESBROW" of oWNDCHILD

       REDEFINE SAY oSay1     var cSay1       ID 121 of oEMP   // motorpool
       REDEFINE SAY oSay2     var cSay2       ID 122 of oEMP   // for dates
       REDEFINE SAY oSay3     var cSay3       ID 123 of oEMP   // thru
       REDEFINE SAY oSay4     var cSay4       ID 124 of oEMP   // legend
       REDEFINE GET oSay5     var cSay5  MEMO ID 125 of oEMP COLOR CLR_BLACK, CLR_YELLOW READONLY  // within 500 miles
       oSay5:SetFont( oFontB )
       REDEFINE GET oSay6     var cSay6  MEMO ID 126 of oEMP COLOR CLR_WHITE, RGB(192,3,51) READONLY  // past due
       oSay6:SetFont( oFontB )

       * REDEFINE SAY oSay8 ID 140 OF oInvt UPDATE
  *     oSay8:SetFont( oFontB )
  *     oSay8:SetColor( CLR_BLUE )

       REDEFINE SAY oMOTORPOOL var cMOTORPOOL ID 114 of oEMP
       REDEFINE SAY oMOTOR     var xMOTOR     ID 113 of oEMP
       REDEFINE SAY oDATE1     var dDATE1     ID 119 of oEMP
       REDEFINE SAY oDATE2     var dDATE2     ID 120 of oEMP

   // here is the xBrowse //

   REDEFINE xBROWSE oBrow  ;
       ARRAY aData ;
       HEADERS aHeader ;
       ID 111 OF oEMP  ;
       LINES CELL

 

Image
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Using an Array for xBrowse Header

Postby nageswaragunupudi » Tue Feb 14, 2017 8:27 pm

Code: Select all  Expand view
aHeader := {"Vnumber","License","Cur_Mil","NextService","Serv_Due" }
Regards

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

Re: Using an Array for xBrowse Header

Postby Rick Lipkin » Tue Feb 14, 2017 8:36 pm

Rao

It seems I have asked this question before and you answered it before :

viewtopic.php?f=3&t=31169&p=180875&hilit=xbrowse+array+header#p180875

In my previous example there was no COLUMNS expression, hence the A B C D E .. Since I am dynamically creating the headers based on a changing spread of records .. your earlier answer was a GOOD solution .. I modified a small test and this worked :

Code: Select all  Expand view

aHeader := { ;
           { 1,  "Vnumber",        nil, 65 }, ;
           { 2,  "License",        nil, 65 }, ;
           { 3,  "Cur_Mil",        nil, 65 }, ;
           { 4,  "NextService",    nil, 65 }, ;
           { 5,  "Serv_Due",       nil, 65 } }



AADD( aData, {"01001","SG12345","10000","12/03/2016","10000"} )


DEFINE ICON oIco RESOURCE "AKEY"
DEFINE WINDOW oWNDCHILD MDICHILD      ;
       FROM 1,1 to 35,125             ;
       of oWNDMDI                     ;
       NOZOOM                         ;
       NOMINIMIZE                     ;
       ICON oIco                      ;
       TITLE cTitle

   DEFINE DIALOG oEMP RESOURCE "RESBROW" of oWNDCHILD

       REDEFINE SAY oSay1     var cSay1       ID 121 of oEMP   // motorpool
       REDEFINE SAY oSay2     var cSay2       ID 122 of oEMP   // for dates
       REDEFINE SAY oSay3     var cSay3       ID 123 of oEMP   // thru
       REDEFINE SAY oSay4     var cSay4       ID 124 of oEMP   // legend
       REDEFINE GET oSay5     var cSay5  MEMO ID 125 of oEMP COLOR CLR_BLACK, CLR_YELLOW READONLY  // within 500 miles
       oSay5:SetFont( oFontB )
       REDEFINE GET oSay6     var cSay6  MEMO ID 126 of oEMP COLOR CLR_WHITE, RGB(192,3,51) READONLY  // past due
       oSay6:SetFont( oFontB )

       * REDEFINE SAY oSay8 ID 140 OF oInvt UPDATE
  *     oSay8:SetFont( oFontB )
  *     oSay8:SetColor( CLR_BLUE )

       REDEFINE SAY oMOTORPOOL var cMOTORPOOL ID 114 of oEMP
       REDEFINE SAY oMOTOR     var xMOTOR     ID 113 of oEMP
       REDEFINE SAY oDATE1     var dDATE1     ID 119 of oEMP
       REDEFINE SAY oDATE2     var dDATE2     ID 120 of oEMP


   REDEFINE xBROWSE oLbx  ;
       ARRAY aData ;
       COLUMNS aHeader ;
       ID 111 OF oEMP  ;
       LINES CELL
 


I am going to put this code in my FW code snipits so I can remember this when I get 'feeble' again next time :D

Thanks again Rao !
Rick Lipkin
Image
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 62 guests