FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour xBrowse using SetAlign provokes an error
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
xBrowse using SetAlign provokes an error
Posted: Thu Nov 04, 2010 04:34 PM
Hi,

if I use SetAlign with FW10.09 in following way:

Code (fw): Select all Collapse
            oLB:aCols[3]:SetAlign( AL_RIGHT )
            oLB:aCols[4]:SetAlign( AL_RIGHT )

with oLB being my xBrowse, I get following error:

Application
===========
Path and name: D:\cto_win\eho40\eho.exe (32 bits)
Size: 6,246,912 bytes
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 04.11.2010, 17:29:40
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL
Args:
[ 1] = U

Stack Calls
===========
Called from: => EVAL(0)
Called from: .\source\classes\xbrowse.prg => (b)TXBROWSE:TXBROWSE(383)
Called from: => TXBROWSE:KEYCOUNT(0)
Called from: .\source\classes\xbrowse.prg => TXBROWSE:REFRESH(1127)
Called from: .\source\classes\xbrowse.prg => TXBRWCOLUMN:SETALIGN(8416)
Called from: AD_MAIN.prg => E_ADRESSEN(221)
Called from: EHO.prg => STARTADRESSEN(1257)
Called from: EHO.prg => (b)EHO_INIT(923)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:KEYDOWN(2546)
Called from: .\source\classes\MDICLIEN.PRG => TMDICLIENT:KEYDOWN(243)
Called from: => TMDICLIENT:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(3394)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(978)
Called from: EHO.prg => MAIN(680)


If I remove the oBrw:Refresh() from SetAlign (in xBrowse.prg), the error disappears:

Code (fw): Select all Collapse
METHOD SetAlign( nAlign ) CLASS TXBrwColumn

   if ValType( nAlign ) == 'N'
      nAlign      := MinMax( nAlign, 0, 2 )
      if nAlign != ::nDataStrAlign
         ::nDataStrAlign      := nAlign
         ::nDataStyle         := ::DefStyle( nAlign, ::oBrw:nDataLines == 1 )
         //::Refresh() <= I removed this line
      endif
   endif

Return Self


Is there a bug in this method or am I doing something wrong?
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse using SetAlign provokes an error
Posted: Thu Nov 04, 2010 05:58 PM

Try putting a sysrefresh() in front of the ::oBrw:refresh().

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: xBrowse using SetAlign provokes an error
Posted: Fri Nov 05, 2010 08:29 AM
James Bott wrote:Try putting a sysrefresh() in front of the ::refresh().

Same error still exists...
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse using SetAlign provokes an error
Posted: Fri Nov 05, 2010 05:19 PM

Gilbert,

Can you put together a small sample program showing the problem?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse using SetAlign provokes an error
Posted: Sat Nov 06, 2010 01:18 PM
  1. SetAlign() method is intended to be used for changing alignment during runtime. Recommended way to set alignment of columns, during initial definition of xbrowse, is by oCol:nDataStrAlign := <nAlign>.

  2. From the error code, it is understood that data source is not yet specified ( in command mode ALIAS, ARRAY, RECORDSET, etc or in oops style, SetRDD, SetArray, etc ) before defining columns and properties. That is the reason bKeyCount is undefined when SetAlign is called. Recommended way is to set the data source before defining columns.

  3. As our friend suggested it would be nice if u post a self contained example.

Regards



G. N. Rao.

Hyderabad, India
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: xBrowse using SetAlign provokes an error
Posted: Tue Nov 09, 2010 08:52 AM
Rao,

nageswaragunupudi wrote:1. SetAlign() method is intended to be used for changing alignment during runtime. Recommended way to set alignment of columns, during initial definition of xbrowse, is by oCol:nDataStrAlign := <nAlign>.

Thanks, this works

nageswaragunupudi wrote:
2. From the error code, it is understood that data source is not yet specified ( in command mode ALIAS, ARRAY, RECORDSET, etc or in oops style, SetRDD, SetArray, etc ) before defining columns and properties. That is the reason bKeyCount is undefined when SetAlign is called. Recommended way is to set the data source before defining columns.

Right, this was the problem

nageswaragunupudi wrote:
3. As our friend suggested it would be nice if u post a self contained example.

as the problem is solved and because it was my fault: is an example still eligible?
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse using SetAlign provokes an error
Posted: Tue Nov 09, 2010 09:32 AM

Glad that the problem is solved.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: xBrowse using SetAlign provokes an error
Posted: Tue Nov 09, 2010 02:56 PM
as the problem is solved and because it was my fault: is an example still eligible?


Maybe a small sample showing how you got it working would help others avoid the same problem you had.

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion