LB Booster
« Wish List »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 03:45am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Wish List  (Read 1614 times)
bluatigro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 111
xx Re: Wish List
« Reply #12 on: Feb 1st, 2015, 2:33pm »



Code:
try
catch
end try
 

Code:
call subname a( 13 ) , a( 14 ) , a( 15 )
end
sub subname byref x , byref y , byref  z
end sub
 
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Wish List
« Reply #13 on: Feb 1st, 2015, 3:23pm »

on Feb 1st, 2015, 2:33pm, bluatigro wrote:
Code:
try
catch
end try 

Any other votes for this?

Quote:
Code:
call subname a( 13 ) , a( 14 ) , a( 15 )
end
sub subname byref x , byref y , byref  z
end sub 

Good catch! That should definitely work (in LBB), the fact that it doesn't is a mistake on my part. I'll fix it in the next release. Thank you!

Richard.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Wish List
« Reply #14 on: Feb 8th, 2015, 1:45pm »

on Jan 27th, 2015, 5:55pm, Richard Russell wrote:
OK, I have added RESUME NEXT to my Work In Progress version.

Sorry to mess you around, but I've taken it out again! I decided that with SEH being supported in the next release of LBB it didn't make much sense to support the outdated RESUME NEXT as well.

The SEH equivalent to the previous simple example is as follows, and it's much nicer (IMHO):

Code:
    CLS
    FOR i = -5 TO 5
      TRY
        PRINT i, 1 / i
      CATCH
        PRINT Err$; " happened but we ignore and continue"
      END TRY
    NEXT
    END 

And here is the SEH equivalent to the more complex example; no GOTOs, no labels, this is how modern code should be written!:

Code:
    CrLf$ = chr$(13);chr$(10)

    'some ordinary code
    Text1$ = Text1$ + "Hello" + CrLf$

    'isolate dangerous code
    Try
      Call Reciprocal 1
    Catch
      Text1$ = Text1$ + "!!! Some error happened" + CrLf$
    End Try
    
    'some more ordinary code
    Text1$ = Text1$ + "Hello again" + CrLf$
    
    'second piece of dangerous code - this will break
    Try
      Call Reciprocal 0
    Catch
      Text1$ = Text1$ + "!!! Some error happened" + CrLf$
    End Try
    
    'last piece of ordinary code
    Text1$ = Text1$ + "last Hello"
    Print Text1$
    End

Sub Reciprocal n
    dummy = 1 / n
End Sub 

Richard.
« Last Edit: Feb 8th, 2015, 1:48pm by Richard Russell » User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls