iNTERFACEWARE Products Manual > Learning Center > Learning Python > Functions and Global Variables > Parameters |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
You can use one or more parameters to supply values to a function. (This is also known as passing values to a function.) The following example contains a function that prints an HL7 delimiter and a statement that calls this function:
In this function, fieldlevel is the function's parameter. When the function is called, a value must be supplied for this parameter; in this example, the supplied value is 1, which means that the ^ character is printed. Here is another example, this time using two parameters instead of one:
The second parameter for this function specifies the number of times that the delimiter character is to be printed. In this example, the output is ^^^. When you call a function, you must supply its parameters in the correct order. The first value you pass to the function is matched with the first parameter, the second value is matched with the second parameter, and so on. In the above example, the first parameter, fieldlevel, has the value 1, and the second parameter, count, has the value 3. |