OsGetNotecardLine

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
'''osGetNotecardLine'''(string name, integer line)
+
{|  width="100%" style="border: thin solid black"
 +
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
 +
|- valign="top"
 +
|'''Threat Level''' || VeryHigh
  
This function directly reads a line of text from the specified notecard, if it exists within the task inventory, and returns the text as a string. It skips the dataserver event, thereby reducing code complexity. This function has a threat level of Very High:
+
|- valign="top"
 
+
|'''Function Syntax''' || <source lang="lsl">
''From OSSL_Api.cs:''  
+
osGetNotecardLine(string name, integer line)
:::"due to the synchronous method this function uses to fetch assets, its use may be dangerous and unreliable while running in grid mode."
+
</source>
 
+
|- valign="top"
<source lang="lsl">
+
|'''Example(s)||<source lang="lsl">
 
//Example usage:
 
//Example usage:
 
default {
 
default {
Line 19: Line 22:
 
</source>
 
</source>
  
 +
|}
  
 +
This function directly reads a line of text from the specified notecard, if it exists within the task inventory, and returns the text as a string. It skips the dataserver event, thereby reducing code complexity.
  
[[Category:OSSL]]
+
[[Category:OSSL Functions]]

Revision as of 08:38, 11 June 2011

OsGetNotecardLine
Threat Level VeryHigh
Function Syntax
osGetNotecardLine(string name, integer line)
Example(s)
//Example usage:
default {
    state_entry() {
        integer i;
        string notecard = llGetInventoryName(INVENTORY_NOTECARD, 0);
        for(i=1; i&lt;=osGetNumberOfNotecardLines(notecard); i++) {
            llSay(0, osGetNotecardLine(notecard, i));
        }
    }
}

This function directly reads a line of text from the specified notecard, if it exists within the task inventory, and returns the text as a string. It skips the dataserver event, thereby reducing code complexity.

Personal tools
General
About This Wiki