Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Aug 09, 2020 1:10 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Help Please. OutOfBounds Error
PostPosted: Thu May 03, 2012 10:57 pm 
Offline

Joined: Thu May 03, 2012 10:51 pm
Posts: 1
Hello. I recently got the trial of real software and i tried out a few tutorials. i was testing out my finished URL Manager from the tutorial and when my URL list box is empty, and i hit delete, the application will crash because of an unhandled OutOfBoundsException.

It states "An exception of class OutOfBoundsException was not handled. The application must shut down.

Is there any way i can stop this and make a pop-up window stating "There are no URL's to delete"?

Im new to coding and real software.


Top
 Profile  
Reply with quote  
 Post subject: Re: Help Please. OutOfBounds Error
PostPosted: Fri May 04, 2012 1:07 am 
Offline
User avatar

Joined: Mon Jan 02, 2012 1:51 am
Posts: 382
Location: India
Yes,

Before writting the code to delete from listBox, first check if there is any entry in the listBox. Like

if ListBox1.ListCount > 0 Then

//Your delete code goes here

Else
MsgBox "There are no URL's to delete"

End if


You can also disable the delete button first and enable it only when there is any row selected. In ListBox change event, you can write

if me.SelCount >= 1 Then
//Enable the button
Else
//Disable the button
End If


you can always handle the exception by using a "Try...catch" block or "Exception" block.

_________________
Amitava Karan
Real Studio 2012 Release 1
Windows 7 (32 bit)
Mac OS X Version 10.7


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group