User Defined Functions Standards
This Page contains instructions on submitting UDF's for AutoIt3, it helps me if code is submitted following the below standards and include these 2 files::
You will appreciate that we can only include those UDF's that are useful to a larger group of
scripter's.
When you still like your UDF to be included :-) then:
Thanks,
Gary
User Defined Function coding standards
Function Names
All function names must start with an underscore (“_”). *
Each word in the function name should be capitalized.
The first word of the function name should start with a word describing
a general category such as “Date”, “String”,
“Array”, “Network”, etc.. If the word is too
long like “Window”, then an obvious abbreviation may be
used (e.g. “Win” for “Window” or
“Net” for “Network”).
All function names must closely resemble the established naming convention for "internal" AutoIt functions.
Variable Names
The first set of characters after the dollar sign (“$”)
should be used to specify the type of data that will be held in it. The
following list signifies the different prefixes and their data type
significance.
$a<letter> - Array (the following letter describes the data type taken from the rest of the data types below)
$b - Binary data
$h - File or window handle
$i - Integer
$f - Boolean
$n - Floating point number
$s - String
$v - Variant (unknown/variable type of data)
The rest of the name uses capitalized words to describe the function of
the variable. Names like “$iC” are unacceptable.
"$aiWeekDayNames" or "$iCounter" are much preferable.
All variables must be declared at the beginning of the UDF with a
“Local” scope and before they are used for the first time.
The “Dim” or “Global” keywords are ambiguous
inside of a UDF and as such should be avoided, all variables should be
transferred via the Function Parameters using Byref when the updated
value needs to be returned.
Parameters
The parameter names must use the same naming conventions as variables.
All parameters must be checked for validity and return appropriate error codes.
If parameters are used to pass data back to the calling script (ByRef),
then the documentation should explicitly describe said behavior.
Function Documentation
All UDFs must have a documentation header in the script in the following form:
; #FUNCTION# ;=============================================================================== |
Function Helpfile Documentation
All submitted UDFs must include 1 extra file to be able to incorporate them in the Helpfile:
FunctionName.AU3. This is the example to be included in the Helpfile
(Example):
#include <Date.au3> |