OsFormatString

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{|  width="100%" style="border: thin solid black"
+
{{osslfunc
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
+
|threat_level=Low
|- valign="top"
+
|function_syntax=string osFormatString(string format,list params)
|'''Threat Level''' || Low
+
|ossl_example=<source lang="lsl">
 
+
|- valign="top"
+
|'''Function Syntax''' || <source lang="lsl">
+
string osFormatString(string format,list params)
+
</source>
+
|- valign="top"
+
|'''Example(s)||<source lang="lsl">
+
 
//
 
//
 
//osFormatString() example, by Tom Earth.
 
//osFormatString() example, by Tom Earth.
Line 23: Line 16:
 
}
 
}
 
</source>
 
</source>
 
+
|description=Return the string with parameters substituted into it. These parameters need to be incrementing numbers, starting at zero, and surrounded by single accolades (also known as curly brackets).
|}
+
|
<Additional info/content goes here>
+
}}
 
+
[[Category:OSSL Functions]]
+

Latest revision as of 10:57, 30 July 2011

string osFormatString(string format,list params)
Return the string with parameters substituted into it. These parameters need to be incrementing numbers, starting at zero, and surrounded by single accolades (also known as curly brackets).
Threat Level Low
Permissions No permissions specified
Extra Delay No function delay specified
Example(s)
//
//osFormatString() example, by Tom Earth.
//
default
{
    state_entry()
    {
        string to_format = "My name is {0}. My owner is {1}. I am in the sim {2}";
        list format = [llGetObjectName(),llKey2Name(llGetOwner()),llGetRegionName()];
        llOwnerSay(osFormatString(to_format, format)); 
    }
}
Personal tools
General
About This Wiki