View Single Post
  #4   Spotlight this post!  
Unread 20-03-2003, 19:18
redbeard0531 redbeard0531 is offline
Registered User
#0686 (Bovine Intervention)
 
Join Date: Jan 2003
Location: New Market, MD
Posts: 40
redbeard0531 is an unknown quantity at this point
Send a message via AIM to redbeard0531
Re: clock

Quote:
Originally posted by The Lucas
Could someone please explain the purpose of gosub? It is just a goto with a return statement, totally worthless.
GoSub is an important feature from the basic lineage. Remember, pBasic is used for much more than just our robots.In the BASICs, a sub-routene is like a void function in C/C++/Java. An important aspect of a subroutene is that it will always go back to where it was called from. This is especialy important in code recycling. Imagine if you had to keep track of every place that a function is called from! It also helps with organization; every section can have it own subroutene that each subsystem can work on independently of the rest of the program.
Reply With Quote