gosub - return


Closed Thread
Results 1 to 5 of 5

Thread: gosub - return

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I haven't tried it personally because its never really necessary.

    If you want to know what happens, try it
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2


    Did you find this post helpful? Yes | No

    Default Multiple entry points to a subroutine

    DoSomeTimes:
    code block 1
    DoOften:
    code block 2
    Return

    The above structure lets you have two separate entry points with a single return. I use this structure when I want to recalibrate a sensor for example.

    Calling GOSUB DoOften gets the result of the sensor.
    Calling GOSUB DoSomeTimes starts with a calibration routine then gets the results of the sensor.

    your mileage may vary but the idea works for me.

    HTH
    BrianT

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