xbrowse question?

xbrowse question?

Postby dutch » Wed Jun 21, 2017 2:14 am

Dear All,

I try to create small program to see the index expression. It has 3 columns in array but it shows 4 columns in the xbrowse as picture.
Image
What is the matter?
Code: Select all  Expand view
#include 'fivewin.ch'

Function main( cTable )
local lStart, aIndexKey, aIndex
local oDlg, oBrw, oBtn, oSay, oFont
local cPath, aDBF, n, x

Default cTable := ''

REQUEST DBFCDX, DBFFPT

cTable += iif(upper(right(cTable,4))='.DBF','','*.DBF')

cPath := curdrive()+':'+curdir()+'\'
aDBF := Directory(cPath+cTable)

if !empty(aDBF)
   lStart := .T.
else
   MsgWait('
Table : '+cTable+' does not exist',,1)
   lStart := .F.
end

if lStart
   aIndexKey := {}
   for n := 1 to len(aDBF)
       cTable := left(aDBF[n][1],len(aDBF[n][1])-4)
       if file(cPath+cTable+'
.CDX')
          DbUseArea( .T., '
DBFCDX', cTable, 'TMP', .T., .T. )
          DbSetIndex( cTable )
          aIndex := IndexInfo(cTable)
          TMP->(DbCloseArea())
          for x := 1 to len(aIndex)
              aadd( aIndexKey, { aIndex[x][1], aIndex[x][2], aIndex[x][3] } )
          next
       end
   next

DEFINE FONT oFont NAME '
Tahoma' SIZE 0, -14

DEFINE DIALOG oDlg FROM 0, 0 TO 500, 900 TITLE '
Index Table' PIXEL FONT oFont
   oDlg:lHelpIcon := .F.

   @  2, 2 XBROWSE oBrw ARRAY aIndexKey ;
           COLUMNS 1, 2, 3 ;
           HEADERS '
Table', 'Tag', 'Expression' ;
           COLSIZES 100, 100, 543 ;
           SIZE 447, 247 ;
           PIXEL ;
           oDlg
           
   oBrw:nMarqueeStyle      := MARQSTYLE_HIGHLROW
   oBrw:nRowDividerStyle   := LINESTYLE_LIGHTGRAY
   oBrw:nColDividerStyle   := LINESTYLE_LIGHTGRAY
   oBrw:nHeaderHeight      := 26
   oBrw:nRowHeight         := 24
   oBrw:lHScroll           := .F.
   oBrw:lVScroll           := .T.
   oBrw:nStretchCol        := STRETCHCOL_LAST
   oBrw:lAllowRowSizing    := .F.

   oBrw:CreateFromCode()          
           
   oDlg:oClient := oBrw

ACTIVATE DIALOG oDlg CENTER

oFont:End()
end
return nil

*---------------------------*
Function IndexInfo(cTable)
local aOrders := {}
local j, n

n := OrdCount()
FOR j:=1 TO n
     aadd( aOrders, { iif(j=1,cTable,'
'), OrdName(j) , UPPER(OrdKey(j)) } )
NEXT

Thank you in advance for any help and suggestion.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: xbrowse question?

Postby nageswaragunupudi » Wed Jun 21, 2017 2:24 am

In the definition of xbrowse please see this part of the code:
Code: Select all  Expand view
         PIXEL ;
           oDlg
 

Please change it as
Code: Select all  Expand view
         PIXEL ;
           OF oDlg       // add OF before oDlg
 
Regards

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

Re: xbrowse question?

Postby dutch » Wed Jun 21, 2017 2:28 am

Dear Mr.Rao,

Thank you so much and apologize for stupid question.

Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 103 guests