V4RB2 bug 648 -> REALBASIC BUG

Sims, John ayu8 at cdc.gov
Wed Apr 27 08:15:51 CDT 2005


<snip>
> OK, thank you very much, Jon for this advice.
> 
> Then, I made effectively this test... it is effectively Realbasic who 
> has a bug.. Pfffff...
> 
> In a loop I attribute a string to an array of 500 000 variables, 
> realbasic puts 20 ticks to make the operation.
> 11 ticks with #pragma disableBackgroundTask.
> 
> However now I makes the same thing but by putting a block 
> "Try" on the 
> last 1000 passages of the loop (and with 1000 errors),
> The operation puts 6333 ticks...  6325 ticks with the 
> pragma... If I puts the block " try " but that there is NO 
> error on 1000 passages 
> of the loop:  21 ticks...
> 
> I am going to send a message on the RB' list.
> It is  bad  because I think of RS will not correct the bug before 
> months...
> 
> olivier

Hi Olivier,

I saw your posts here and in the RB list archives.  I think the problem
is you seem to be combining the 2 different ways of dealing with
exceptions in RB.  If you want to use the "try" block, think of it as a
"try-catch" block and that will help keep it straight in your head.  The
"try-catch" block looks like this...

Try
{your code goes here}
Catch ex as [whatever type of exception you wish to trap]
{the code here is what you want to do should you encounter an exception
of the type you are trapping for}
Finally (optional)
{this section basically allows you to do any clean-up if necessary as
this code will execute even if you encounter an exception}
End Try

As you see, the "Exception" keyword is not used in a try-catch block.
The "Exception" keyword is the other way of trapping exceptions.  It
looks like this...

Sub [or Function]
{your code goes here.  Make sure you return an appropriate value if the
method is a function}

Exception err
{the code here is what you want to do should you encounter an exception}

End Sub [or Function]

I hope this helps and let us know how making these changes affects you
test app :-)

-John


More information about the Valentina mailing list