OsGetNumberOfNotecardLines

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Ah, some LSL source formatting escaped my attention....)
Line 1: Line 1:
'''osGetNumberOfNotecardLines'''(string name)
+
{|  width="100%" style="border: thin solid black"
 +
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
 +
|- valign="top"
 +
|'''Threat Level''' || VeryHigh
  
This function directly reads how many lines a notecard has if the specified notecard exists within the task inventory, bypassing the dataserver event to reduce code complexity.  This function has a threat level of Very High:
+
|- valign="top"
 
+
|'''Function Syntax''' || <source lang="lsl">
<br> ''From OSSL_Api.cs:''  
+
osGetNumberOfNotecardLines(string name)
<blockquote>"due to the synchronous method this function uses to fetch assets, its use may be dangerous and unreliable while running in grid mode."</blockquote>  
+
</source>
 
+
|- valign="top"
 
+
|'''Example(s)||<source lang="lsl">//Example usage:
<source lang="lsl">//Example usage:
+
 
default {
 
default {
 
     state_entry() {
 
     state_entry() {
Line 19: Line 21:
 
</source>
 
</source>
  
 +
|}
  
 +
This function directly reads how many lines a notecard has if the specified notecard exists within the task inventory, bypassing the dataserver event to reduce code complexity.
  
[[Category:OSSL]]
+
[[Category:OSSL Functions]]

Revision as of 08:40, 11 June 2011

OsGetNumberOfNotecardLines
Threat Level VeryHigh
Function Syntax
osGetNumberOfNotecardLines(string name)
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 how many lines a notecard has if the specified notecard exists within the task inventory, bypassing the dataserver event to reduce code complexity.

Personal tools
General
About This Wiki