Thread: subs/functions
View Single Post
  #2   Spotlight this post!  
Unread 16-02-2003, 16:33
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,562
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
there are no functions in pbasic. The closest you have is subroutines accessed by gosub. You can not pass parameters to subroutines and so, you must use global variables.

If you wanted to get fancy, you could use part of the scratchpad memory as a stack, and push function parameters onto it just like a c compiler does, but you are asking for trouble, and it would take time.