LB Booster
« trapclose error »

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



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: trapclose error  (Read 374 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx trapclose error
« Thread started on: Aug 22nd, 2016, 3:58pm »

If the destination label in a trapclose statement does not exist - perhaps a spelling error - I don't see any error message. It looks like the program is hung up, and the window will not close.

I would like to see some kind of error message, perhaps at the bottom of the screen.

r.m.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: trapclose error
« Reply #1 on: Aug 22nd, 2016, 5:56pm »

on Aug 22nd, 2016, 3:58pm, Alincon wrote:
I would like to see some kind of error message, perhaps at the bottom of the screen.

I don't think there's any practical (and safe) way that can be achieved, sorry. Hopefully testing would quickly lead to a realisation that the trapclose isn't working.

For your interest, the difficulty arises from the fact that an event handler can be specified in so many different ways:
  • A 'do nothing' event: []
  • A branch label: [handler]
  • A subroutine name: handler
  • A word returned by INPUT: HelloWorld
I wonder how many people remember (or ever knew) that the fourth option exists:

Code:
    button #w, "Click Me", ButtonClicked, UL, 50, 50
    open "Test" for dialog as #w
    #w "trapclose QuitNow"
    do    
      input r$
      print r$
    loop until r$ = "QuitNow"
    close #w
    end 

LB 4 doesn't allow the fourth kind of event handler (a word returned by INPUT) with trapclose, but LBB treats all events alike so it does.

Richard.
« Last Edit: Aug 22nd, 2016, 6:31pm 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