Template:Bcode:Syntax
From Wikibooks, open books for an open world
The bcode templates are designed to be included into pages as templates for specific formatting of code. Bcode is merely a shortening of Basic Code (though no relation to BASIC or Visual Basic) which represents the fact that these are very simple formats.
Following this are all four styles of format.
Rules for using the templates are as follows (although no one is here to enforce them:
- They are all called using: bcode:name followed by the arguments all within two brackets (like a standard template)
- No pre tags are necessary and all variable names are expected.
- Variables are to be italicized (through <variable>Variable</variable> tags, simple wiki italic, or any other method, though wiki italic is preferred for its easiness).
[edit] Available Templates
- Syntax - The syntax of a programming language function (or any other applicable use)
- Example - An example of a programming language function (or any other applicable use)
- Output - What the output of a program would look like if run
[edit] Syntax
The first argument is the syntax of a programming language function (or any other applicable use) and the second argument is limitations to the code:
printMessage(msg)
- Where msg is a message to output to the user. msg must
- be less than 255 characters in length
- end with the '@' character
The code for the above follows:
{{bcode:Syntax|
printMessage(''msg'')
|
*Where ''msg'' is a message to output to the user. ''msg'' must
**be less than 255 characters in length
**end with the '@' character
}}