Template:BSLfuncinfo: Difference between revisions

From OniGalore
Jump to navigation Jump to search
(looks like the highest # of args actually used is 7, but the engine max is 8 so I'll just go with that; it must have been my imagination that BSL supported variadic functions)
(adding HTML anchor that can be used for redirecting to specific function on page)
Line 1: Line 1:
<includeonly>{|
<includeonly>{{Anchor|{{{name|placeholder}}}}}{|
!<!--"type" label, OS icons, "default" label-->
!<!--"type" label, OS icons, "default" label-->
!<!--func type, name, default return value-->
!<!--func type, name, default return value-->

Revision as of 02:17, 15 November 2015


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.

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.

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.

{{BSLfunc
|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= }}