bug report: sbrowse without vertical scroll

bug report: sbrowse without vertical scroll

Postby AntoninoP » Tue Mar 03, 2015 8:30 am

Hello,
I created a xbrowse without vertical scrolling and the program crashed at line 2466 of xbrowse.prg:
Code: Select all  Expand view
     case nKey == K_PGUP
         ::oVScroll:PageUp()

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

I already fixed it locally:
Code: Select all  Expand view
     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
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: bug report: sbrowse without vertical scroll

Postby nageswaragunupudi » Wed Mar 04, 2015 1: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
User avatar
nageswaragunupudi
 
Posts: 10635
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug report: sbrowse without vertical scroll

Postby AntoninoP » Wed Mar 04, 2015 2: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:
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: bug report: sbrowse without vertical scroll

Postby nageswaragunupudi » Wed Mar 04, 2015 2: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
User avatar
nageswaragunupudi
 
Posts: 10635
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: bug report: sbrowse without vertical scroll

Postby AntoninoP » Fri Mar 06, 2015 3:24 pm

You are right, the crash is pressing CTRL+C and CTRL+R.
Maybe i was trying to copy the cell value :?
AntoninoP
 
Posts: 375
Joined: Tue Feb 10, 2015 9:48 am
Location: Albenga, Italy

Re: bug report: sbrowse without vertical scroll

Postby nageswaragunupudi » Fri Mar 06, 2015 3: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
User avatar
nageswaragunupudi
 
Posts: 10635
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 52 guests