- Creating an algorithm
- The code
- Running and debugging
- Renaming algorithms
- Deleting algorithms
- Clearing flags
- Best practices
Arguments are the pieces of information that you would like the user to supply the algorithm. When your algorithm is executed, the user will be prompted to enter a value for each of the arguments.
When designing your algorithm, you enter the arguments as a list separated by commas. Each argument name should be alphanumeric and begin with a $ symbol. Remember to give your arguments descriptive names!
After at least one argument has been entered, the argument definitions section will appear immediately below the argument list. It can be toggled open and shut by clicking the section title. Here you can set the argument type, default value, and other options for each argument. These options are described below.
The most important thing that the argument definition allows you to specify is the type of the argument. By default the type is unspecified, and you are under no obligation to change this. Many algorithms will work just fine using arguments of an unspecified type. In other cases it may be necessary to choose a more specific type, so that the user's input is translated into the proper form.
In the example below, try selecting different types for the argument. Note how choosing some types brings up additional options. If you want, after you change the argument type, press the rescan button and then run it (this algorithm will simply print the type of the argument to the screen).
No matter what argument type you choose, in the argument definition you have the option of entering a default value. The user's input form will be prefilled with this value.
Some argument types, such as text and image, allow you to specify the possible input options, which are the methods of entry available to the user. Options are keyboard (meaning the user will type the data in), file (meaning a file from the user's computer), and web address (meaning the user will provide an URL from which the data can be retreived).
The comment describes the argument and/or gives instructions about what data to enter. The comment can be seen by users who run the algorithm.
In even more detail
Further information about each of the different types and the options available for each are given in the following sections.