FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bug report: sbrowse without vertical scroll
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
bug report: sbrowse without vertical scroll
Posted: Tue Mar 03, 2015 08:30 AM
Hello,
I created a xbrowse without vertical scrolling and the program crashed at line 2466 of xbrowse.prg:
Code (fw): Select all Collapse
      case nKey == K_PGUP
         ::oVScroll:PageUp()

      case nKey == K_PGDN
         ::oVScroll:PageDown()

I already fixed it locally:
Code (fw): Select all Collapse
      case nKey == K_PGUP
         if ::oVScroll != nil  
            ::oVScroll:PageUp()
         endif

      case nKey == K_PGDN
         if ::oVScroll != nil 
            ::oVScroll:PageDown()
         endif

I hope it is useful,
Perry
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: bug report: sbrowse without vertical scroll
Posted: Wed Mar 04, 2015 01:28 PM
I created a xbrowse without vertical scrolling and the program crashed at line 2466 of xbrowse.prg:

Which key did you press?
In my tests I find that these lines are never executed. PgDn and PgUp keys are handled by KeyDown method.
That is the reason I am interested in knowing pressing which key generated this error.
Please clarify
Regards



G. N. Rao.

Hyderabad, India
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: bug report: sbrowse without vertical scroll
Posted: Wed Mar 04, 2015 02:20 PM

I am not able to reproduce,
I see that K_PGUP and K_PGDN are undefined, the correct values are VK_PRIOR and VK_NEXT.

:roll:

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: bug report: sbrowse without vertical scroll
Posted: Wed Mar 04, 2015 02:46 PM
AntoninoP wrote:I am not able to reproduce,
I see that K_PGUP and K_PGDN are undefined, the correct values are VK_PRIOR and VK_NEXT.


VK_PRIOR and VK_NEXT are handled in Method KeyDown() and pressing any PgDn or PgUp keys never executes the lines of code you mentioned. Still because you said your application crashed, I am wondering what PgDn and PgUp keys you pressed which resulted in application crash. I think no pgup/pgdn keys can create this problem unless I am missing something in my tests.

K_PGUP and K_PGDN are defined in Inkey.ch.
Pressing Ctrl-R or Ctrl-C execute these lines of code and can result in runtime error when oVScroll is nil.

This is a legacy code from the time xbrowse was first created and does not serve the intended purpose any more. Right fix is to remove these lines of code and that is what I am doing now.
Regards



G. N. Rao.

Hyderabad, India
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
Re: bug report: sbrowse without vertical scroll
Posted: Fri Mar 06, 2015 03:24 PM

You are right, the crash is pressing CTRL+C and CTRL+R.
Maybe i was trying to copy the cell value :?

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: bug report: sbrowse without vertical scroll
Posted: Fri Mar 06, 2015 03:28 PM
AntoninoP wrote:You are right, the crash is pressing CTRL+C and CTRL+R.
Maybe i was trying to copy the cell value :-)

Yes. When we try to copy cell value with Ctrl-C and oVScroll is nil. we get into this error.
We now removed these two lines.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion