Optional Arguments: Difference between revisions
Jump to navigation
Jump to search
m (Optional arguments moved to Optional Arguments) |
No edit summary |
||
Line 1: | Line 1: | ||
Optional arguments are arguments | [[Optional Arguments]] are arguments that are sent to a command but are not required for the command to run. | ||
When loolking at the Syntax for an argument, Optional arguments are always enclosed in Square brackets | |||
Example: | |||
vehicle createVehicle ( model, x, y, z [, rx, ry, rz ] ) | |||
In this example, '''rx''', '''ry''', and '''rz''' are [[Optional Arguments]]. | |||
==Using Optional Arguments== | |||
[[Optional Arguments]] have one limitation. You cannot use any optional arguments unless ''all previous arguments are also supplied.'' | |||
This means that in the previous example, if you wanted to supply '''rz''', you would also need to supply '''rx''', and '''ry''' ''in order.'' |
Revision as of 22:11, 23 March 2006
Optional Arguments are arguments that are sent to a command but are not required for the command to run.
When loolking at the Syntax for an argument, Optional arguments are always enclosed in Square brackets
Example:
vehicle createVehicle ( model, x, y, z [, rx, ry, rz ] )
In this example, rx, ry, and rz are Optional Arguments.
Using Optional Arguments
Optional Arguments have one limitation. You cannot use any optional arguments unless all previous arguments are also supplied.
This means that in the previous example, if you wanted to supply rz, you would also need to supply rx, and ry in order.