cancelling gosubs


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    Hi Peter,

    Thanks for your reply.

    If you GOSUB in a program, then you must have a RETURN... or you will still be in a GOSUB stack. You can divert the program to go do something else as you have stated... but you are effectively still in the GOSUB.

    Sorta like leaving the toilette seat up in a house full of women. It can be done but I wouldn't recommend it.

    My original question was "could I put the toilette seat down with a remote control" (so I wouldn't have to walk back to the bathroom).

    or maybe it was...

    could I GOSUB... then from somewhere else in the program... CANCEL the GOSUB (so I wouldn't have to RETURN to the line following the GOSUB). Diverting to another part of the program is still effectively leaving the GOSUB (toilette seat) open.

    Thanks again for your reply...

    Ross

    ...a remotely controlled 'johnny seat'... There's a product there somewhere. Probably need a safety switch... or... NOT. **evil laugh**
    Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!

    I like that! :-)

  2. #2
    Join Date
    Nov 2004
    Location
    Fribourg, Switzerland
    Posts
    9


    Did you find this post helpful? Yes | No

    Smile Software Stack

    Hi All,

    I was sniffing the net and I have found a quite interesting stack subroutine that the authors claims to let PBP do up to 48 nested gosubs.

    The url is:

    http://www.pbpgroup.com/modules/wfse...p?articleid=14

    I haven't tested so I can't say if it really works or not but if it does , it's quite an improvement to write more structured programs.

    Hope it can help.

    Hans

Similar Threads

  1. cancelling a GOSUB without RETURN
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2007, 14:30
  2. variables and gosubs???
    By guest_05 in forum mel PIC BASIC Pro
    Replies: 38
    Last Post: - 19th November 2006, 02:46
  3. GoSub Problem
    By ghoot in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th May 2004, 15:15

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts