View Single Post
  #2   Spotlight this post!  
Unread 22-01-2005, 11:11
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: Can anyone create new commands?

What do you mean by 'commands?' Are you referring to functions? Or are you referring to the autonomous program provided by FIRST? If you're talking about built-in functions, then you certainly can! The basic format of a function is this:
(replace the items in square brackets with the proper keywords)
Code:
[returntype] [functionname]([argtype1] [argname1],[argtype2] [argname2]...){
/*Your code here*/
return [result];
}
For example:
Code:
double squareit(double numberToBeSquared){
return numberToBeSquared*numberToBeSquared;
}
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!