Error with Xbrowse many fields

Error with Xbrowse many fields

Postby Ehab Samir Aziz » Wed Jun 11, 2008 1:37 am

I faced that error when I increased number of fields in Xbrowse.
My version is FWH 7.01 :

Application
===========
Path and name: H:\programs\clipper\FWH\Hany\tmain.exe (32 bits)
Size: 1,319,936 bytes
Time from start: 0 hours 0 mins 2 secs
Error occurred at: 11/06/2008, 04:33:52
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 36

Stack Calls
===========
Called from: => TSURVEY:BROWSER(91)
Called from: => (b)BUILDMENU(65)
Called from: => TMENU:COMMAND(0)
Called from: => TWINDOW:COMMAND(0)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: => TWINDOW:ACTIVATE(0)
Called from: => TAPP:ACTIVATE(52)
Called from: TMAIN.PRG => MAIN(17)

This is line 91 :
oBrw:aCols[ nFor ]:oDataFont := oFont // Line 91


Code: Select all  Expand view  RUN
method browser() CLASS TSurvey
*-------------------------------------
   local oDlg,oBrw,oSurvey,oFont,oCol,nFor,oChild

   ::setOrder(1)
   ::gotop()

   define font oFont name "Ms Sans Serif" size 0,-14 BOLD

   DEFINE DIALOG oDlg FROM 0,0 TO 45,128 TITLE "Applicant Main DataBrowse "

   *Style nor( WS_VSCROLL, WS_HSCROLL, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_POPUP, WS_THICKFRAME )

   *   TITLE If( lAppend, "New Machine", "Machine Update" );
   *       Style nor( WS_VSCROLL, WS_HSCROLL )
   *STYLE nOr( WS_CAPTION, WS_SYSMENU, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_POPUP, WS_THICKFRAME)

   oBrw := TXBrowse():New( oDlg )
   oBrw:nMarqueeStyle       := MARQSTYLE_HIGHLCELL
   oBrw:nColDividerStyle    := LINESTYLE_BLACK
   oBrw:nRowDividerStyle    := LINESTYLE_BLACK
   oBrw:lColDividerComplete := .t.
   oBrw:nHeaderLines        := 1
   oBrw:nFooterLines        := 1
   oBrw:nDataLines          := 1
   oBrw:lFooter             := .t.
   oBrw:CreateFromCode()
   oBrw:nTop = 0
   oBrw:nLeft = 0
   oBrw:nWidth = 1000
   oBrw:nHeight =600
   oBrw:SetRDD()

      for nFor := 1 to ::Fcount()
         oBrw:aCols[ nFor ]:oDataFont := oFont // Line 91
      next

   // Setup for using database class
   oBrw:cAlias:= ::cAlias
   oBrw:bSkip:= {|nRecs| ::skipper( nRecs ) }
   oBrw:bGotop:= {|| ::gotop() }
   oBrw:bGoBottom:= {|| ::goBottom() }
   oBrw:bBookMark := {| n | iif( n == nil, ::RecNo() , ::Goto( n ) ) }
   oBrw:bKeyCount := {|| ( ::cAlias )->( OrdKeyCount() ) }
   oBrw:bKeyNo    := {| n | iif( n == nil,;
                     ( ::cAlias )->( OrdKeyNo() ),;
                     ( ::cAlias )->( OrdKeyGoto( n ) ) ) }

   oSurvey:= self
   ACTIVATE DIALOG oDlg ;
      ON INIT (oBrw:SetSize( 1000, 600 ), BuildButtons( oSurvey,oBrw,oDlg),oBrw:Refresh(.t.), oDlg:Refresh(.t.))



RETURN self
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Thu Jun 12, 2008 7:37 am

Ehab,

Check if these values are the same:

MsgInfo( ::Fcount() )
MsgInfo( Len( oBrw:aCols ) )

Whats the source code for ::FCount() ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Ehab Samir Aziz » Thu Jun 12, 2008 6:38 pm

MsgInfo( ::Fcount() ) : gets 84 which is the number of fields
MsgInfo( Len( oBrw:aCols ) ): gets 35 !!!
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Thu Jun 12, 2008 7:55 pm

Please check that you have selected the right workarea before calling method SetRdd()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby nageswaragunupudi » Fri Jun 13, 2008 12:00 pm

It is highly desirable to assign
Code: Select all  Expand view  RUN
oBrw:cAlias := <Required Alias>

soon after creating the browse object.
Regards

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

Postby Ehab Samir Aziz » Fri Jun 13, 2008 9:06 pm

Fixed . Thanks
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm


Return to FiveWin for Harbour/xHarbour

Who is online

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