User:ArceusInator/Template:Function: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>ArceusInator
what a function template may be like
 
>ArceusInator
No edit summary
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><div style="float:left; padding:2px; width:600px; height:150px; overflow:auto; margin:2px;">
<div style="float:left; padding:2px; width:600px; height:150px; overflow:auto; margin:2px;">
{| cellspacing="0" cellpadding="4" style="-webkit-border-radius: 6px; -moz-border-radius: 6px; background: #ffdddd; margin:0; width: 100%; font-size: 90%; text-align: left; align: center; padding: 4px; border: solid 4px #B57EDC;"
{|cellspacing="0" cellpadding="4" style="-webkit-border-radius: 6px; -moz-border-radius: 6px; background: #ffdddd; margin:0; width: 100%; font-size: 90%; text-align: left; align: center; padding: 4px; border: solid 4px #B57EDC;"
|style="padding: 1;font-size:120%; font-weight:bold;" colspan="2"|[[Image:{{if|{{{protected|}}}|Protected_}}Method Icon.png]] [[{{{name}}} (Method)|{{{name}}}]]( {{{arguments<includeonly>|</includeonly>}}} )
|style="padding: 1;font-size:120%; font-weight:bold;" colspan="2"|[[Image:{{if|{{{protected|}}}|Protected_}}Method Icon.png]] [[{{{name}}} (Method)|{{{name}}}]]( {{{arguments}}} )
|-style="background: #FFFFFF;"
|-style="background: #FFFFFF;"
|style="width: 10%; border-top: solid 1px black; border-right: solid 1px black; font-weight:bold;"|Returns
|style="width: 10%; border-top: solid 1px black; border-right: solid 1px black; font-weight:bold;"|Returns
Line 10: Line 10:
|-style="background: #FFFFFF;"
|-style="background: #FFFFFF;"
|style="width: 10%; border-top: solid 1px black; border-right: solid 1px black; font-weight:bold;"|Type:
|style="width: 10%; border-top: solid 1px black; border-right: solid 1px black; font-weight:bold;"|Type:
|style="border-top: solid 1px black;"|{{Ifeq|{{{type}}}|core|[[Function_Dump/Core_Functions|Core Function]]|{{Ifeq|{{{type}}}|coroutine|[[Function_Dump/Coroutine_Manipulation|Coroutine Function]]|{{Ifeq|{{{type}}}|string|[[String Function]]|{{Ifeq|{{{type}}}|table|[[Function_Dump/Table_Manipulation|Table Function]]|Ifeq|{{{type}}}|math|[[Function_Dump/Mathematical_Functions|Mathematical Function]]|[[Function_Dump/Roblox_Specific_Functions|Roblox Specific Function]]}}}}}}}}}}|}</div></onlyinclude><noinclude>{{clear floats}}
|style="border-top: solid 1px black;"|
== Example Usage ==
{{Ifeq|{{{type}}}|core|[[Function_Dump/Core_Functions|Core Function]]|
{{Ifeq|{{{type}}}|coroutine|[[Function_Dump/Coroutine_Manipulation|Coroutine Function]]|
{{Ifeq|{{{type}}}|string|[[Function_Dump/String_Manipulation|String Function]]|
{{Ifeq|{{{type}}}|table|[[Function_Dump/Table_Manipulation|Table Function]]|
{{Ifeq|{{{type}}}|math|[[Function_Dump/Mathematical_Functions|Mathematical Function]]|
[[Function_Dump/Roblox_Specific_Functions|Roblox Specific Function]]
}}
}}
}}
}}
}}
|}</div><noinclude>{{clear floats}}


This template has these properties:<pre>
==Example Usage==
 
The following properties are valid:<pre>
property      : Value = Default


name          : String
name          : String
description    : String
arguments      : String
arguments      : String
description    : String
returns        : String = nil
returns        : String = nil
protected      : Boolean = false
protected      : Boolean = false
type          : type = roblox
type          : Type = roblox


These are the types that are used with the "type" property:
Here's a list of inputs the "type" property can accept:


core
core
coroutine
coroutine
math
string
string
table
table
math
roblox
roblox


Anything else acts as if it were set to "roblox"</pre>
Anything else will be treated as if it were roblox.</pre>
 
Here's what LoadLibrary may be written as:


=== Function ===
<pre>
<pre>
{{User:ArceusInator/Template:Function
{{User:ArceusInator/Template:Function
|name       = LoadLibrary
|name = LoadLibrary
|arguments   = [[String]] ''libraryName''
|arguments = [[String]] ''libraryName''
|returns     = [[Userdata]] ''requestedLibrary''
|returns = [[Userdata]]
|description = Returns a library, 'libraryName' if it exists. Else, it returns nil and an error message for use with the assert function.  
|description = Returns a library, 'libraryName' if it exists. Else, it returns nil and an error message for use with the assert function.}}  
|type        = roblox
}}
</pre>
</pre>


Results in
this would result in:




{{User:ArceusInator/Template:Function
{{User:ArceusInator/Template:Function
|name       = LoadLibrary
|name = LoadLibrary
|arguments   = [[String]] ''libraryName''
|arguments = [[String]] ''libraryName''
|returns     = [[Userdata]] ''requestedLibrary''
|returns = [[Userdata]]
|description = Returns a library, 'libraryName' if it exists. Else, it returns nil and an error message for use with the assert function.  
|description = Returns a library, 'libraryName' if it exists. Else, it returns nil and an error message for use with the assert function.}}
|type        = roblox
}}
 


</noinclude>
</noinclude>

Latest revision as of 03:58, 23 March 2011

[[{{{name}}} (Method)|{{{name}}}]]( {{{arguments}}} )
Returns {{{returns}}}
Description: {{{description}}}
Type:

Roblox Specific Function


Example Usage

The following properties are valid:

property       : Value = Default

name           : String
description    : String
arguments      : String
returns        : String = nil
protected      : Boolean = false
type           : Type = roblox

Here's a list of inputs the "type" property can accept:

core
coroutine
math
string
table
roblox

Anything else will be treated as if it were roblox.

Here's what LoadLibrary may be written as:

{{User:ArceusInator/Template:Function
|name = LoadLibrary
|arguments = [[String]] ''libraryName''
|returns = [[Userdata]]
|description = Returns a library, 'libraryName' if it exists. Else, it returns nil and an error message for use with the assert function.}} 

this would result in:


LoadLibrary( String libraryName )
Returns Userdata
Description: Returns a library, 'libraryName' if it exists. Else, it returns nil and an error message for use with the assert function.
Type:

Roblox Specific Function