Converting your Classpad program to function:
Write your program normally with the Classpad Program Editor. After, export and upload the PRGM (*.xcp) here.
You must follow these rules:
-You can use only If, Else, For, While, Do(condition tests), Return and Local commands.
-You cannot assign values to a list or matrix (1->list[2] is forbidden)
-You must declare all the variables used as local variables, excepted the parameters
-You cannot access to variables stored in memory
-You must use Return <value> to stop the program and display the <value> (Return <value> doesn't work if you execute it in a program)
Thanks to kilburn for discovery of this trick.
An example of a program created with this tool is helder7's Unit Converter Function.