Template:BSLfuncinfo: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (linebreak needed?)
m (replaced font style underlined with heavy)
 
(57 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>{{Anchor|{{{name|placeholder}}}}}
<includeonly>{{Anchor|{{{name|placeholder}}}}}
{|
{| class="BSLFuncInfo"
!<!--"type" label, OS icons, "default" label-->
!<!--func type, name, default return value-->
!<!--arg 1 type, name, default value-->
!<!--arg 2 type, name, default value-->
!<!--arg 3 type, name, default value-->
!<!--arg 4 type, name, default value-->
!<!--arg 5 type, name, default value-->
!<!--arg 6 type, name, default value-->
!<!--arg 7 type, name, default value-->
!<!--arg 8 type, name, default value-->
|-
|-
|type:
|{{{type|}}}<!--
|{{{type|}}}
-->{{#if:{{{arg1name|}}}|<br />
|align="center"|{{{arg1type|}}} {{#if:{{{arg1alttype|}}}|<u>or</u> {{{arg1alttype|}}}}} {{#if:{{{arg1optional|}}}|(optional)|}}
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg1optional|}}}|''|}}{{{arg1type|}}} {{#if:{{{arg1alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg1alttype|}}}}}|<br />
|align="center"|{{{arg2type|}}} {{#if:{{{arg2alttype|}}}|<u>or</u> {{{arg2alttype|}}}}} {{#if:{{{arg2optional|}}}|(optional)|}}
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}<!--
|align="center"|{{{arg3type|}}} {{#if:{{{arg3alttype|}}}|<u>or</u> {{{arg3alttype|}}}}} {{#if:{{{arg3optional|}}}|(optional)|}}
-->{{#if:{{{arg2name|}}}|<br />
|align="center"|{{{arg4type|}}} {{#if:{{{arg4alttype|}}}|<u>or</u> {{{arg4alttype|}}}}} {{#if:{{{arg4optional|}}}|(optional)|}}
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg2optional|}}}|''|}}{{{arg2type|}}} {{#if:{{{arg2alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg2alttype|}}}}}|{{#if:{{{arg1name|}}}|<br />
|align="center"|{{{arg5type|}}} {{#if:{{{arg5alttype|}}}|<u>or</u> {{{arg5alttype|}}}}} {{#if:{{{arg5optional|}}}|(optional)|}}
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}<!--
|align="center"|{{{arg6type|}}} {{#if:{{{arg6alttype|}}}|<u>or</u> {{{arg6alttype|}}}}} {{#if:{{{arg6optional|}}}|(optional)|}}
-->{{#if:{{{arg3name|}}}|<br />
|align="center"|{{{arg7type|}}} {{#if:{{{arg7alttype|}}}|<u>or</u> {{{arg7alttype|}}}}} {{#if:{{{arg7optional|}}}|(optional)|}}
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg3optional|}}}|''|}}{{{arg3type|}}} {{#if:{{{arg3alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg3alttype|}}}}}|{{#if:{{{arg2name|}}}|<br />
|align="center"|{{{arg8type|}}} {{#if:{{{arg8alttype|}}}|<u>or</u> {{{arg8alttype|}}}}} {{#if:{{{arg8optional|}}}|(optional)|}}
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}<!--
-->{{#if:{{{arg4name|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg4optional|}}}|''|}}{{{arg4type|}}} {{#if:{{{arg4alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg4alttype|}}}}}|{{#if:{{{arg3name|}}}|<br />
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}<!--
-->{{#if:{{{arg5name|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg5optional|}}}|''|}}{{{arg5type|}}} {{#if:{{{arg5alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg5alttype|}}}}}|{{#if:{{{arg4name|}}}|<br />
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}<!--
-->{{#if:{{{arg6name|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg6optional|}}}|''|}}{{{arg6type|}}} {{#if:{{{arg6alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg6alttype|}}}}}|{{#if:{{{arg5name|}}}|<br />
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}<!--
-->{{#if:{{{arg7name|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg7optional|}}}|''|}}{{{arg7type|}}} {{#if:{{{arg7alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg7alttype|}}}}}|{{#if:{{{arg6name|}}}|<br />
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}<!--
-->{{#if:{{{arg8name|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{#if:{{{arg8optional|}}}|''|}}{{{arg8type|}}} {{#if:{{{arg8alttype|}}}|<span style="font-weight:1000;">or</span> {{{arg8alttype|}}}}}|{{#if:{{{arg7name|}}}|<br />
{{Pipe}}[[Image:Edit-pencil.png|link={{{name}}}|Edit this info]]}}|}}
|-
|-
|{{#ifeq:{{{mac|yes}}}|no|{{#ifeq:{{{win|yes}}}|no|[[Image:Cmbox deletion.png|20px]]                                <!--if neither platform, show error icon
|'''{{{name}}}('''<!--
                                              -->|[[Image:Platform-Win.png|20px]] [[Image:Platform-empty.png|20px]] <!--if only Win, show Win and blank icon
-->{{#if:{{{arg1name|}}}|<br /><!--                                 if this arg exists... -->
                      -->}}<!--
{{Pipe}}align="center"{{Pipe}}'''<!--                               create a cell, then...
                      -->|{{#ifeq:{{{win|yes}}}|no|[[Image:Platform-empty.png|20px]] [[Image:Platform-Mac.png|20px]] <!--if only Mac, show blank and Mac icon
-->{{#if:{{{arg1optional|}}}|''|}}<!--                              start italics if optional arg
                                              -->|[[Image:Platform-Win.png|20px]] [[Image:Platform-Mac.png|20px]]  <!--if both platforms, show both icons
-->{{{arg1name|}}}<!--                                               print arg name
                      -->}}<!--
-->{{#if:{{{arg1altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg1altname|}}}}}<!-- print " or " and alternate arg name if supplied
-->}}
-->{{#if:{{{arg1optional|}}}|''|}}<!--                               end italics if optional arg
|style="font-size:166%; vertical-align:bottom"|{{{name}}}(
-->{{#if:{{{arg2name|}}}|, |}}|<br /><!--                           and if there is a next arg, print a comma -->
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg1name|}}}<!--
{{Pipe}}''' );}}<!--                                                 else if no args, just close parentheses
                                                -->|{{#if:{{{arg1optional|}}}|''|}}<!--         start italics if optional arg
-->{{#if:{{{arg2name|}}}|<br />
                                                  -->{{{arg1name|}}}<!--                         print arg 1 name if supplied
{{Pipe}}align="center"{{Pipe}}'''<!--
                                                  -->{{#if:{{{arg1altname|}}}<!--
-->{{#if:{{{arg2optional|}}}|''|}}<!--
                                                      -->|&nbsp;<u>or</u> {{{arg1altname|}}}<!--print alternative arg 1 if present
-->{{{arg2name|}}}<!--
                                                      -->|<!--
-->{{#if:{{{arg2altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg2altname|}}}}}<!--
                                                  -->}}<!--
-->{{#if:{{{arg2optional|}}}|''|}}<!--
                                                  -->{{#if:{{{arg1optional|}}}|''|}}<!--         end italics if optional arg
-->{{#if:{{{arg3name|}}}|, |}}|{{#if:{{{arg1name|}}}|<br />
                                                  -->{{#if:{{{arg2name|}}}|, |}}<!--             if there is a next arg, print comma
{{Pipe}}''' ); |}}}}<!--
                                                -->|void );<!--                                 if no args, print "void" and a close parens
-->{{#if:{{{arg3name|}}}|<br />
                                            -->}}
{{Pipe}}align="center"{{Pipe}}'''<!--
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg2name|}}}<!--
-->{{#if:{{{arg3optional|}}}|''|}}<!--
                                                -->|{{#if:{{{arg2optional|}}}|''|}}<!--
-->{{{arg3name|}}}<!--
                                                  -->{{{arg2name|}}}<!--
-->{{#if:{{{arg3altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg3altname|}}}}}<!--
                                                  -->{{#if:{{{arg2altname|}}}<!--
-->{{#if:{{{arg3optional|}}}|''|}}<!--
                                                      -->|&nbsp;<u>or</u> {{{arg2altname|}}}<!--
-->{{#if:{{{arg4name|}}}|, |}}|{{#if:{{{arg2name|}}}|<br />
                                                      -->|<!--
{{Pipe}}''' ); |}}}}<!--
                                                  -->}}<!--
-->{{#if:{{{arg4name|}}}|<br />
                                                  -->{{#if:{{{arg2optional|}}}|''|}}<!--
{{Pipe}}align="center"{{Pipe}}'''<!--
                                                  -->{{#if:{{{arg3name|}}}|, |}}<!--
-->{{#if:{{{arg4optional|}}}|''|}}<!--
                                                -->|{{#if:{{{arg1name|}}}| ); |}}<!--          if this was last arg, close parentheses
-->{{{arg4name|}}}<!--
                                            -->}}
-->{{#if:{{{arg4altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg4altname|}}}}}<!--
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg3name|}}}<!--
-->{{#if:{{{arg4optional|}}}|''|}}<!--
                                                -->|{{#if:{{{arg3optional|}}}|''|}}<!--
-->{{#if:{{{arg5name|}}}|, |}}|{{#if:{{{arg3name|}}}|<br />
                                                  -->{{{arg3name|}}}<!--
{{Pipe}}''' ); |}}}}<!--
                                                  -->{{#if:{{{arg3altname|}}}<!--
-->{{#if:{{{arg5name|}}}|<br />
                                                      -->|&nbsp;<u>or</u> {{{arg3altname|}}}<!--
{{Pipe}}align="center"{{Pipe}}'''<!--
                                                      -->|<!--
-->{{#if:{{{arg5optional|}}}|''|}}<!--
                                                  -->}}<!--
-->{{{arg5name|}}}<!--
                                                  -->{{#if:{{{arg3optional|}}}|''|}}<!--
-->{{#if:{{{arg5altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg5altname|}}}}}<!--
                                                  -->{{#if:{{{arg4name|}}}|, |}}<!--
-->{{#if:{{{arg5optional|}}}|''|}}<!--
                                                -->|{{#if:{{{arg2name|}}}| ); |}}<!--
-->{{#if:{{{arg6name|}}}|, |}}|{{#if:{{{arg4name|}}}|<br />
                                            -->}}
{{Pipe}}''' ); |}}}}<!--
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg4name|}}}<!--
-->{{#if:{{{arg6name|}}}|<br />
                                                -->|{{#if:{{{arg4optional|}}}|''|}}<!--
{{Pipe}}align="center"{{Pipe}}'''<!--
                                                  -->{{{arg4name|}}}<!--
-->{{#if:{{{arg6optional|}}}|''|}}<!--
                                                  -->{{#if:{{{arg4altname|}}}<!--
-->{{{arg6name|}}}<!--
                                                      -->|&nbsp;<u>or</u> {{{arg4altname|}}}<!--
-->{{#if:{{{arg6altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg6altname|}}}}}<!--
                                                      -->|<!--
-->{{#if:{{{arg6optional|}}}|''|}}<!--
                                                  -->}}<!--
-->{{#if:{{{arg7name|}}}|, |}}|{{#if:{{{arg5name|}}}|<br />
                                                  -->{{#if:{{{arg4optional|}}}|''|}}<!--
{{Pipe}}''' ); |}}}}<!--
                                                  -->{{#if:{{{arg5name|}}}|, |}}<!--
-->{{#if:{{{arg7name|}}}|<br />
                                                -->|{{#if:{{{arg3name|}}}| ); |}}<!--
{{Pipe}}align="center"{{Pipe}}'''<!--
                                            -->}}
-->{{#if:{{{arg7optional|}}}|''|}}<!--
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg5name|}}}<!--
-->{{{arg7name|}}}<!--
                                                -->|{{#if:{{{arg5optional|}}}|''|}}<!--
-->{{#if:{{{arg7altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg7altname|}}}}}<!--
                                                  -->{{{arg5name|}}}<!--
-->{{#if:{{{arg7optional|}}}|''|}}<!--
                                                  -->{{#if:{{{arg5altname|}}}<!--
-->{{#if:{{{arg8name|}}}|, |}}|{{#if:{{{arg6name|}}}|<br />
                                                      -->|&nbsp;<u>or</u> {{{arg5altname|}}}<!--
{{Pipe}}''' ); |}}}}<!--
                                                      -->|<!--
-->{{#if:{{{arg8name|}}}|<br />
                                                  -->}}<!--
{{Pipe}}align="center"{{Pipe}}'''<!--
                                                  -->{{#if:{{{arg5optional|}}}|''|}}<!--
-->{{#if:{{{arg8optional|}}}|''|}}<!--
                                                  -->{{#if:{{{arg6name|}}}|, |}}<!--
-->{{{arg8name|}}}<!--
                                                -->|{{#if:{{{arg4name|}}}| ); |}}<!--
-->{{#if:{{{arg8altname|}}}|&nbsp;<span style="font-weight:1000;">or</span> {{{arg8altname|}}}}}<!--
                                            -->}}
-->{{#if:{{{arg8optional|}}}|''|}}|{{#if:{{{arg7name|}}}|<br />
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg6name|}}}<!--
{{Pipe}}''' ); |}}}}
                                                -->|{{#if:{{{arg6optional|}}}|''|}}<!--
                                                  -->{{{arg6name|}}}<!--
                                                  -->{{#if:{{{arg6altname|}}}<!--
                                                      -->|&nbsp;<u>or</u> {{{arg6altname|}}}<!--
                                                      -->|<!--
                                                  -->}}<!--
                                                  -->{{#if:{{{arg6optional|}}}|''|}}<!--
                                                  -->{{#if:{{{arg7name|}}}|, |}}<!--
                                                -->|{{#if:{{{arg5name|}}}| ); |}}<!--
                                            -->}}
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg7name|}}}<!--
                                                -->|{{#if:{{{arg7optional|}}}|''|}}<!--
                                                  -->{{{arg7name|}}}<!--
                                                  -->{{#if:{{{arg7altname|}}}<!--
                                                      -->|&nbsp;<u>or</u> {{{arg7altname|}}}<!--
                                                      -->|<!--
                                                  -->}}<!--
                                                  -->{{#if:{{{arg7optional|}}}|''|}}<!--
                                                  -->{{#if:{{{arg8name|}}}|, |}}<!--
                                                -->|{{#if:{{{arg6name|}}}| ); |}}<!--
                                            -->}}
|style="font-size:166%; vertical-align:bottom"|{{#if:{{{arg8name|}}}<!--
                                                -->|{{#if:{{{arg8optional|}}}|''|}}<!--
                                                  -->{{{arg8name|}}}<!--
                                                  -->{{#if:{{{arg8altname|}}}<!--
                                                      -->|&nbsp;<u>or</u> {{{arg8altname|}}}<!--
                                                      -->|<!--
                                                  -->}}<!--
                                                  -->{{#if:{{{arg8optional|}}}|''|}}<!-- no check for comma after this since this is the last possible arg
                                                -->|{{#if:{{{arg7name|}}}| ); |}}<!--
                                            -->}}
|-
|-
|default:
|default: {{#if:{{{default|}}}|{{{default|}}}| --}}<!-- print "--" if there is no default return value for function
|              {{#if:{{{default|}}}   |{{{default|}}}| --}}                               <!-- print "--" if there is no default return value for function -->
-->{{#if:{{{arg1default|}}}|<br />
|align="center"|{{#if:{{{arg1default|}}}|{{{arg1default|}}}|{{#if:{{{arg1name|}}}| --|}}|}} <!-- print "--" if there is arg in this position with no default -->
{{Pipe}}align="center"{{Pipe}}{{{arg1default|}}}|{{#if:{{{arg1name|}}}|<br />
|align="center"|{{#if:{{{arg2default|}}}|{{{arg2default|}}}|{{#if:{{{arg2name|}}}| --|}}|}}
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
|align="center"|{{#if:{{{arg3default|}}}|{{{arg3default|}}}|{{#if:{{{arg3name|}}}| --|}}|}}
-->{{#if:{{{arg2default|}}}|<br />
|align="center"|{{#if:{{{arg4default|}}}|{{{arg4default|}}}|{{#if:{{{arg4name|}}}| --|}}|}}
{{Pipe}}align="center"{{Pipe}}{{{arg2default|}}}|{{#if:{{{arg2name|}}}|<br />
|align="center"|{{#if:{{{arg5default|}}}|{{{arg5default|}}}|{{#if:{{{arg5name|}}}| --|}}|}}
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
|align="center"|{{#if:{{{arg6default|}}}|{{{arg6default|}}}|{{#if:{{{arg6name|}}}| --|}}|}}
-->{{#if:{{{arg3default|}}}|<br />
|align="center"|{{#if:{{{arg7default|}}}|{{{arg7default|}}}|{{#if:{{{arg7name|}}}| --|}}|}}
{{Pipe}}align="center"{{Pipe}}{{{arg3default|}}}|{{#if:{{{arg3name|}}}|<br />
|align="center"|{{#if:{{{arg8default|}}}|{{{arg8default|}}}|{{#if:{{{arg8name|}}}| --|}}|}}
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
|}</includeonly><noinclude>
-->{{#if:{{{arg4default|}}}|<br />
 
{{Pipe}}align="center"{{Pipe}}{{{arg4default|}}}|{{#if:{{{arg4name|}}}|<br />
'''BSLfunc''' allows for standardized listing of BSL functions. Since BSL allows for functions to take up to eight arguments, and each argument has to be described here by up to six parameters, this makes '''BSLfunc''' the most complex template on the wiki. However, you'll rarely need to use more than a few of these parameters to describe an average function.
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
-->{{#if:{{{arg5default|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{{arg5default|}}}|{{#if:{{{arg5name|}}}|<br />
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
-->{{#if:{{{arg6default|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{{arg6default|}}}|{{#if:{{{arg6name|}}}|<br />
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
-->{{#if:{{{arg7default|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{{arg7default|}}}|{{#if:{{{arg7name|}}}|<br />
{{Pipe}}align="center"{{Pipe}} --|}}|}}<!--
-->{{#if:{{{arg8default|}}}|<br />
{{Pipe}}align="center"{{Pipe}}{{{arg8default|}}}|{{#if:{{{arg8name|}}}|<br />
{{Pipe}}align="center"{{Pipe}} --|}}|}}
|}</includeonly><noinclude>'''BSLfuncinfo''' allows for standardized listing of BSL functions. Since BSL allows for functions to take up to eight arguments, and each argument can be described here by up to six parameters, this makes '''BSLfuncinfo''' the most complex template on the wiki. However, you'll rarely need to use more than a few of these parameters to describe an average function.


Parameters:
Parameters:
Line 164: Line 151:
:If a BSL function can take more than one kind of data in a given argument position, give the second argument name here.
:If a BSL function can take more than one kind of data in a given argument position, give the second argument name here.


Here's a default blank call with all parameters up through the fourth argument, which will cover most built-in functions. You can copy-paste the arg4* parameters and change them to arg5*, arg6*, etc. if needed, and you can also delete any parameters you don't need when setting up a call to this template.
Below is a default blank call for all parameters up through the fourth function argument, to save some time. You can omit any parameters you don't need when adding this template to a page.


  <nowiki>{{</nowiki>BSLfunc
  <nowiki>{{</nowiki>BSLfuncinfo
  |type=
  |type=
  |default=
  |default=
Line 198: Line 185:
  <nowiki>}}</nowiki>
  <nowiki>}}</nowiki>


[[Category:Basic formatting templates]]</noinclude>
[[Category:Table templates]]</noinclude>

Latest revision as of 19:05, 8 December 2023

BSLfuncinfo allows for standardized listing of BSL functions. Since BSL allows for functions to take up to eight arguments, and each argument can be described here by up to six parameters, this makes BSLfuncinfo the most complex template on the wiki. However, you'll rarely need to use more than a few of these parameters to describe an average function.

Parameters:

type
Return type of function; should be "int", "string", "float", "bool", or "void".
default
Default return value of function, if there is one at the time the level starts.
name
Name of function.
mac, win
You don't have to use these unless the function is not available and working on one platform; set the appropriate parameter(s) to "no" if that is the case.
arg[1-8]optional
If this argument can be omitted, set this to "yes".
arg[1-8]default
Optional arguments have default assumed values that are used when the argument is not provided; give those values here.
arg[1-8]type
If these arguments to the BSL function exist, give their types here.
arg[1-8]name
If these arguments to the BSL function exist, give their names here.
arg[1-8]alttype
If a BSL function can take more than one kind of data in a given argument position, give the second argument type here.
arg[1-8]altname
If a BSL function can take more than one kind of data in a given argument position, give the second argument name here.

Below is a default blank call for all parameters up through the fourth function argument, to save some time. You can omit any parameters you don't need when adding this template to a page.

{{BSLfuncinfo
|type=
|default=
|name=
|mac=
|win=
|arg1optional= |arg1default= |arg1type= |arg1name= |arg1alttype= |arg1altname=
|arg2optional= |arg2default= |arg2type= |arg2name= |arg2alttype= |arg2altname=
|arg3optional= |arg3default= |arg3type= |arg3name= |arg3alttype= |arg3altname=
|arg4optional= |arg4default= |arg4type= |arg4name= |arg4alttype= |arg4altname= }}