V4RB2 bug 648 -> REALBASIC BUG

Sims, John ayu8 at cdc.gov
Wed Apr 27 09:15:56 CDT 2005


Hi Olivier,

Yes, that looks better.

Out of curiosity, I tried a similar experiment with VB.NET (I'm at work and am forced to use M$ products).  Here is my code in a pushbutton:

 	  Dim i As Integer
        Dim st(999) As String
        Dim iStart As Int64
        Dim iEnd As Int64

        iStart = Now.Ticks
        For i = 0 To 999
            st(i) = "jhljhljhljhljhljhljhljhljhljhjhkjhzzzzzzz"
        Next i
        iEnd = Now.Ticks
        Console.WriteLine(iEnd - iStart)
        iStart = Now.Ticks
        For i = 1000 To 1999
            Try
                st(i) = "jhljhljhljhljhljhljhljhljhljhjhkjhzzzzzzz"
            Catch err As Exception
            End Try
        Next i
        iEnd = Now.Ticks
        Console.WriteLine(iEnd - iStart)

Results:
First run
No handler: 0 ticks
Handler: 63090720 ticks

Second run (crappy .NET never does well on the first run of anything :-/)
No handler: 0 ticks
Handler: 33648384 ticks

In .NET, a tick is defined as "The value of this property is the number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001"

-John


> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of Olivier
> Sent: Wednesday, April 27, 2005 8:28 AM
> To: Valentina Developers
> Subject: Re: V4RB2 bug 648 -> REALBASIC BUG
> 
> 
> thank you John for your answer.
> 
> I made an error of type by sending my e-mail to RB !
> 
> The test is indeed:
> dim st(500000)
> 
>    for i=0 to 500000
>      st(i)="jhljhljhljhljhljhljhljhljhljhjhkjhzzzzzzz"
>    next i
>    for i=500001 to 500500
>      try
>        st(i)="jhljhljhljhljhljhljhljhljhljhjhkjhzzzzzzz"
>      catch err as outOfBoundsException
>      end try
>    next i
> 
> It is correct?
> 
> Olivier
> 
> 
> 
> Le 27 avr. 05, à 14:22, Sims, John a écrit :
> 
> >>
> >> 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
> >
> > Somehow, the format of my e-mail got a little goofy.  Just 
> for clarity 
> > sake...
> >
> > Try
> >
> >
> >
> > Catch ex as [type of exception]
> >
> >
> >
> > Finally
> >
> >
> >
> > End Try
> >
> > Hopefully, this will look better and help clarify my last post if
> > others
> > are seeing the message the same as I :-P
> >
> > -John
> > _______________________________________________
> > Valentina mailing list
> > Valentina at lists.macserve.net 
> > http://lists.macserve.net/mailman/listinfo/valentina
> >
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net 
> http://lists.macserve.net/mailman/listinfo/valentina
> 


More information about the Valentina mailing list