OsGetNotecardLine: Difference between revisions
From OpenSimulator
Jump to navigationJump to search
imported>MakoBot m some syntax modification (may be major or minor) |
imported>Djphil m XEngine to OSSL |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{osslfunc | {{osslfunc | ||
|threat_level=VeryHigh | |threat_level=VeryHigh | ||
|permissions=${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER | |||
|delay=0 | |||
|function_syntax=string osGetNotecardLine(string name, integer line) | |function_syntax=string osGetNotecardLine(string name, integer line) | ||
|ossl_example=<source lang="lsl"> | |ossl_example=<source lang="lsl"> | ||
// | // osGetNotecardLine exemple | ||
default { | |||
state_entry() { | default | ||
{ | |||
state_entry() | |||
{ | |||
integer i; | integer i; | ||
string | string notecard_name = llGetInventoryName(INVENTORY_NOTECARD, 0); | ||
for(i= | integer notecard_line = osGetNumberOfNotecardLines(notecard_name); | ||
llSay( | |||
for(i = 0; i < notecard_line; ++i) | |||
{ | |||
llSay(PUBLIC_CHANNEL, llStringTrim(osGetNotecardLine(notecard_name, i), STRING_TRIM)); | |||
} | } | ||
} | } | ||
} | } | ||
</source> | </source> | ||
|description=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. | |description=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. | ||
|additional_info=The index to lines in a notecard starts at zero. | |||
| | | | ||
}} | }} | ||
Latest revision as of 14:35, 7 November 2019
string osGetNotecardLine(string name, integer line)
| |
| 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. | |
| Threat Level | VeryHigh |
| Permissions | ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER |
| Extra Delay | 0 seconds |
| Example(s) | |
// osGetNotecardLine exemple
default
{
state_entry()
{
integer i;
string notecard_name = llGetInventoryName(INVENTORY_NOTECARD, 0);
integer notecard_line = osGetNumberOfNotecardLines(notecard_name);
for(i = 0; i < notecard_line; ++i)
{
llSay(PUBLIC_CHANNEL, llStringTrim(osGetNotecardLine(notecard_name, i), STRING_TRIM));
}
}
}
| |
| Notes | |
| The index to lines in a notecard starts at zero. | |