- This wiki is out of date, use the continuation of this wiki instead
Standards:function
From FenixWiki
(Difference between revisions)
Revision as of 13:18, 17 April 2007 (edit) Sandman (Talk | contribs) m (Example function moved to Standards function) ← Previous diff |
Current revision (22:27, 12 September 2007) (edit) (undo) Sandman (Talk | contribs) m |
||
(12 intermediate revisions not shown.) | |||
Line 1: | Line 1: | ||
- | [[Category: | + | [[Category:Standards]] |
+ | |||
+ | [[Standards|'''Up to Standards''']] | ||
+ | ---- | ||
+ | |||
+ | |||
+ | Click [[Template:function|here]] to get the template for this standard.<br> | ||
+ | Click [[Function_example|here]] to get an example of this standard. | ||
<pre> | <pre> | ||
NOTE: | NOTE: | ||
- | In the WikiCode, before a new section there | + | In the WikiCode, before a new section there is one empty line and after |
- | Categories can either be at the top or the bottom in the WikiCode. | + | there is one or none. Categories can either be at the top or the bottom |
- | Add a function to the category "functions" and to any other it applies (like " | + | in the WikiCode, but preferred is top as most of the pages have that. |
- | + | Add a function to the category "functions" and to any other it applies | |
+ | (like "networkdll"); if it is a native function, add it do the | ||
+ | category "native": | ||
+ | [[Category:functions]] | ||
+ | When internally linking to a function, do it like so, using the "()": | ||
+ | [[functionname]]() | ||
+ | </pre> | ||
==Definition== | ==Definition== | ||
- | + | '''INT''' example_function ( <'''INT''' example_int> , <'''WORD''' example_word> , [<'''STRING''' example_string>] ) | |
- | '''INT''' | + | |
Does something. | Does something. | ||
Line 21: | Line 33: | ||
"Does something" is a small summary of the function, in one sentence. | "Does something" is a small summary of the function, in one sentence. | ||
Then a white line and then a more indepth story about the function. | Then a white line and then a more indepth story about the function. | ||
- | + | The "[]" indicate an optional parameter. Format WikiCode function definition: | |
+ | '''DATATYPE''' example_function ( [<'''PARAMETERTYPE''' parametername>] ) | ||
- | + | Notice the spaces around the '(', ',' and ')'. The functionname is in all | |
+ | lower case, unless otherwise stated by the creator of the function. | ||
+ | Datatypes are always all uppercase. Parameters can differ a little, but | ||
+ | are mostly only lowercase. | ||
+ | </pre> | ||
+ | == Parameters == | ||
{| | {| | ||
| '''INT''' example_int || - Something about this int. | | '''INT''' example_int || - Something about this int. | ||
Line 31: | Line 49: | ||
| '''WORD''' example_word || - Something about this word. | | '''WORD''' example_word || - Something about this word. | ||
|- | |- | ||
- | | '''STRING''' example_string || - Something about this string. | + | | ['''STRING''' example_string] || - Something about this optional string. |
|} | |} | ||
<pre> | <pre> | ||
NOTE: | NOTE: | ||
- | Use a list, it will result in a much better look. The "-" could be left out, but actually looks nice. | + | Use a list, it will result in a much better look. The "-" could be left out, |
+ | but actually looks nice. | ||
</pre> | </pre> | ||
- | |||
== Returns == | == Returns == | ||
- | |||
'''INT''' : Some int. | '''INT''' : Some int. | ||
+ | {| | ||
+ | | 0 || - Error. | ||
+ | |- | ||
+ | | !0 || - Success. | ||
+ | |} | ||
<pre> | <pre> | ||
Line 54: | Line 76: | ||
</pre> | </pre> | ||
+ | == Errors == | ||
+ | List all [[error]]s which could be thrown by use of this function. If you | ||
+ | don't know how or the function doesn't throw errors, just leave this section | ||
+ | out. If you're certain it errors something, leave a notice that it errors | ||
+ | something, but you don't know what. | ||
== Notes == | == Notes == | ||
- | + | Here are some notes, which explains some parts in more depth. Mostly not | |
- | Here are some notes, which explains some parts in more depth. Mostly not needed, in which case it can be left out. | + | needed, in which case it can be left out. |
- | + | ||
== Example == | == Example == | ||
- | |||
<pre> | <pre> | ||
Program example; | Program example; | ||
Line 74: | Line 99: | ||
NOTE: | NOTE: | ||
Please keep "tabs" at 4 spaces. Try to make the code look tidy and readable. | Please keep "tabs" at 4 spaces. Try to make the code look tidy and readable. | ||
+ | Under the code, outside the pre-tags, list the functions used and possible | ||
+ | other useful pages, like the page about pointers if the example relies on the | ||
+ | knowledge of pointers. First list the functions, then general pages and last | ||
+ | language pages. The last two aren't commonly useful, meaning that a link to | ||
+ | [[Begin]] for example is rarely needed. Consider this example: | ||
+ | |||
+ | Used in example: [[new_map]](), [[map_clear]](), [[pointer]] | ||
</pre> | </pre> |
Current revision
Click here to get the template for this standard.
Click here to get an example of this standard.
NOTE: In the WikiCode, before a new section there is one empty line and after there is one or none. Categories can either be at the top or the bottom in the WikiCode, but preferred is top as most of the pages have that. Add a function to the category "functions" and to any other it applies (like "networkdll"); if it is a native function, add it do the category "native": [[Category:functions]] When internally linking to a function, do it like so, using the "()": [[functionname]]()
Contents |
Definition
INT example_function ( <INT example_int> , <WORD example_word> , [<STRING example_string>] )
Does something.
Here goes a more detailed story about the function.
NOTE: "Does something" is a small summary of the function, in one sentence. Then a white line and then a more indepth story about the function. The "[]" indicate an optional parameter. Format WikiCode function definition: '''DATATYPE''' example_function ( [<'''PARAMETERTYPE''' parametername>] ) Notice the spaces around the '(', ',' and ')'. The functionname is in all lower case, unless otherwise stated by the creator of the function. Datatypes are always all uppercase. Parameters can differ a little, but are mostly only lowercase.
Parameters
INT example_int | - Something about this int. |
WORD example_word | - Something about this word. |
[STRING example_string] | - Something about this optional string. |
NOTE: Use a list, it will result in a much better look. The "-" could be left out, but actually looks nice.
Returns
INT : Some int.
0 | - Error. |
!0 | - Success. |
NOTE: If it returns a code, like an errorcode, you can make a list: {| | some errorcode || - blabla |- | another || - yadayada |}
Errors
List all errors which could be thrown by use of this function. If you don't know how or the function doesn't throw errors, just leave this section out. If you're certain it errors something, leave a notice that it errors something, but you don't know what.
Notes
Here are some notes, which explains some parts in more depth. Mostly not needed, in which case it can be left out.
Example
Program example; Begin Loop frame; End End
NOTE: Please keep "tabs" at 4 spaces. Try to make the code look tidy and readable. Under the code, outside the pre-tags, list the functions used and possible other useful pages, like the page about pointers if the example relies on the knowledge of pointers. First list the functions, then general pages and last language pages. The last two aren't commonly useful, meaning that a link to [[Begin]] for example is rarely needed. Consider this example: Used in example: [[new_map]](), [[map_clear]](), [[pointer]]