Prime: defining functions in a program - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: Articles Forum (/forum-14.html) +--- Thread: Prime: defining functions in a program (/thread-214.html) |
Prime: defining functions in a program - patrice - 12-23-2013 01:26 AM Exemple source code Code:
Respect function parameters in declaration Func3 and Func4 are declared because they are used before being defined. Func1 and Func2 don't need declaration. Func1 and Func4 are visible from outside of the program. At least 1 function must be EXPORTed Respect the EXPORT keyword if a function need declaration. When you declare a function, make an exact copy of the function definition followed by semi. If your functions don't call each other, a simple ordering can avoid declarations. EXPORTed function are visible from everywhere in the calc, including other programs. This open the interesting possibility that you can gather all your common/usual/utility functions in a single utility file and avoid duplicating in every program that use them. |