Return to Extensions Gallery |
Let's give each part of an extension's code a name, so that it can be easily referred to.
This is open for discussion (and this page is editable) so feel free to modify this page if you feel anything obvious has been missed.
Above is an extension breakdown. It defines:
- Extension : A block of code that is capable of being downloaded by STE and used to extend functionality. An extension for STE is a series of instructions, therefore it can also be called a program.
- Header : The first two lines in an Extension. The header defines the name of the extension and information about the creator(s) that will be shown in STE.
- Body : Anything below the header. The body consists of one or more statements. Not shown in above image.
- Statement : Statements can be defined on any line, except lines 1 and 2 (which are reserved for the header). Each statement generally results in STE performing some action. A statement consists of an instruction, and some details that tell STE how to perform that instruction.
- Instruction : The first part of a statement. You might want to read the list of valid instructions.
- Instruction details : Some details that tell STE how to perform the proceeding instruction. For example, it might tell STE to write some text to the text area, or to prompt the user for a value (and to store that value in a variable).
- Variable : The instruction details might sometimes include the name of a variable. A variable is a way for you to store information that can be re-used later. Think of a variable as a name written on a box. You can store whatever data you want in the box, but to retrieve it you need to know the variable name (so you know which box to look into). Read more on Wikipedia.
More about the instruction details:
The layout and format of the instruction details depends on which instruction it is for. As an example, the append instruction accepts any string in the details section, and it can also accept a variable name in the format {$variable_name}.
A single space separates an instruction from its instruction details. If you add additional spaces, they will be treated as if they are part of the details section (this allows you to add blank spaces to the beginning of a line).
Discussion
leiger |
02 Jan 2011 02:06. Edited 0 times. (Edit, Permalink) These are instructions:
These are examples of variables
And this is an example of using a variable with an instruction:
Included page "inc:signature" does not exist (create it now) |
leiger |
02 Jan 2011 02:30. Edited 0 times. (Edit, Permalink) Does this help explain how it works? Included page "inc:signature" does not exist (create it now) |
(user deleted) |
02 Jan 2011 02:41. Edited 0 times. (Edit, Permalink) Included page "inc:signature" does not exist (create it now) |
leiger |
02 Jan 2011 03:01. Edited 0 times. (Edit, Permalink) Initialising them (actually giving them a value using input or one of it's variants) is the equivalent to declaring it first. Included page "inc:signature" does not exist (create it now) |