Copies of these standards can be found within the Standards.fp7 file on this wiki. |
Use one or more spaces before any text is added to a script comment step. This increases the readability of the step by creating a white space margin while reviewing scripts.
|
good |
|
|
bad |
Reading what a script does, what it affects, and how the script has changed is critical to understanding where it fits into the solution. The following guidelines can be used for commenting your scripts.
# # ============================================== # Purpose: Describe the purpose of the script [short version] # Parameters: one ; two ; three # --------------------------- # $one = (enum) load, unload # $two = (string) second parameter # $three = (num) expected # --------------------------- # Called From: (script) any # Author: Matt Petrowsky # History: Last change: 10/10/10 by MP :: A single comment step with multiple lines # Notes: Additional information [long version] # ============================================== # |
The History field within the comment is one single script step which contains the latest change date and a date or date/timestamp line for each change documented. Within the comment step it looks like the following.
History: Last change: 10/10/10 by MP :: 10/9/10 - MP - each line of history is within this one comment step 10/10/10 - MP - added the history field to the comments |
The utility of the history field is being able to use the return key to open the comment dialog for review and close the dialog easily using the escape key.
Using a string expansion program for inserting dates and times into your comments is very helpful. For example, typing dts can be expanded to the current Date time short equivalent. The following are popular packages. |
Custom functions should use, at minimum, the following header
/** * ===================================================== * CustomFunction ( parameter1 ; parameter2 ) * * PARAMETERS: * @parameter1 (text) Input string * @parameter2 (num) Numerical value * RETURNS: * (bool) True or False based on proper * evaluation * DEPENDENCIES: * none * NOTES: * Try to always use the List() function when * passing multiple values into var.eval! * * $checkScriptName is a reserved local * variable used when you wish to enforce * * that inbound parameters match the name of * the script. It is reset after the * * evaluation. * RELEASE: 100917 * ===================================================== * */ |
Using an external editor will make it easier to wrap individual lines to a fixed length. |
The above standards are adapted from the following sources
Wikipedia Doxygen Article
Doxygen Web Site