Descriptions for User Functions


In the function library on the left sidebar, if you hover over the built-in functions, a description of the function will show up.
I was wondering if I could create a description for the functions that I write. I’ve done this in Java before, but is it possible in C?

Thank you

Sorry for the delay, I actually had to play around with this a bit to see if it’s possible (it is). To add your own custom function category names, function names, and comments (with or without pre-filled parameters), there are a couple of things you will need to do.

Before getting started, please note that this process will require tweaking the built-in ROBOTC files and should only be attempted if you are comfortable with the potential of performing an uninstall/reinstall of ROBOTC in the slim chance that something gets messed up or corrupted during the process.

First, find and open the ‘BuiltInVariables.txt’ file in ROBOTC’s install directory (typically C:/Program Files (x86)/Robomatter Inc/ROBOTC Development Environment 4.x). This contains all of the available functions in ROBOTC, as well as how the editor handles where/when they show up.

At the bottom, you will need to add in the custom functions you have created in the following format:

Testing, Commands, V2,	noFeatRest,	*noFeatRest*, F, B, testFunction(param1, param2);//Test comment

Testing: The main category that the function will appear under in the Function library.

Commands: The subcategory that the function will appear under in the Function library.

V2: The platform type(s) that will show the function in the function library. V is for VEX PIC, V2 for VEX Cortex, and V3 for VEX IQ. You can also select ALL to force the command to be shown no matter what platform type is selected.

noFeatRest: Sets whether the function should appear while in Natural Language mode or not. noFeatRest means the function will appear in both normal and Natural Language mode, feat_NaturalLanguageInActive means the function will appear only when Natural Language is disabled, and feat_NaturalLanguageActive means the function will appear only when Natural Language is active

noFeatRest (second instance): Essentially, this should be left as ‘noFeatRest’ for now to ensure it appears in your text-based function library properly.

F: True (T) or False (F) flag to determine if the function should appear in the Graphical Natural Language function library.

B: Minimum menu level required in order to see the function in the function Library. B is for Basic, A for Advanced, and S is for Super User. I is used for internal debugging builds only and should not be set for custom functions (or else you’ll never actually see them).

testFunction(param1, param2); : Name of the custom function, along with any parameters it may have. These are ‘placeholder’ parameters that will get copied into your program when the function is dragged into the code.

//Test comment: The description text for the comment. This is where the custom descriptions come into play.

Once this is done and the text file is saved, you will need to point ROBOTC to the header/c file that contains your custom functions. This can be done through the ‘View -> Preferences -> Detailed Preferences -> Include Directories’ menu, by browsing for the include files’ folder by using the ‘Browse’ button.

Finally, close ROBOTC, reopen and start a new program (with the settings appropriate for your functions), and you should see your functions (with the appropriate mouse-over comments) in the Function Library. Make sure you manually include your header file (using #include) at the top of your program in order to point ROBOTC to the header.