Difference between revisions of "Linkset data"

From Second Life Wiki
Jump to navigation Jump to search
m
m (Updated to account for password protected values)
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
|event=linkset_data
|event=linkset_data
|p1_type=integer|p1_name=action|p1_desc=Action taken on the linkset Datastore
|p1_type=integer|p1_name=action|p1_desc=Action taken on the linkset Datastore
|p2_type=string|p2_name=key|p2_desc=The '''key''' of the '''key:value''' pair.
|p2_type=string|p2_name=name|p2_desc=The '''key''' of the '''name:value''' pair.
|p3_type=string|p3_name=value|p3_desc=The new '''value''' of the pair. Empty string if pair was deleted.
|p3_type=string|p3_name=value|p3_desc=The new '''value''' of the pair. Empty string if pair was deleted or is password-protected (see [[llLinksetDataWriteProtected]]).
|event_footnote=This event fires in all scripts in a linkset whenever the datastore is changed.
|event_footnote=This event fires in all scripts in a linkset whenever the datastore is changed.
|event_desc=The linkset_data event fires in all scripts in a linkset whenever the datastore has been modified through a call to one of the '''llLinksetData''' functions.
|event_desc=The linkset_data event fires in all scripts in a linkset whenever the datastore has been modified through a call to one of the '''llLinksetData''' functions.
|constants={{LSL Constants Linkset_Data}}
|constants={{LSL Constants Linkset_Data Events}}
|spec
|spec
|helpers
|helpers
Line 17: Line 17:
* [[llLinksetDataReset]]
* [[llLinksetDataReset]]
* [[llLinksetDataWrite]]
* [[llLinksetDataWrite]]
* [[llLinksetDataWriteProtected]]
|also_articles
|also_articles
|also_footer
|also_footer
|mode
|mode
|notes=
|notes=
|examples=<source lang="lsl2">default
|examples=<syntaxhighlight lang="lsl2">default
{
{
     linkset_data(integer action, string name, string value)
     linkset_data(integer action, string name, string value)
Line 37: Line 38:
         else if (action == LINKSETDATA_UPDATE)
         else if (action == LINKSETDATA_UPDATE)
         {
         {
             llOwnerSay("Link set datastore key \"" + name + "\" = \"" + value "\".");
             llOwnerSay("Link set datastore key \"" + name + "\" = \"" + value + "\".");
         }
         }
     }
     }
}</source>
}</syntaxhighlight>
|cat1=Script
|cat1=Script
|cat2=LinksetData
|cat2=LinksetData
}}{{LSLC|Prim}}
}}{{LSLC|Prim}}

Latest revision as of 09:46, 28 February 2024

Description

Event: linkset_data( integer action, string name, string value ){ ; }

The linkset_data event fires in all scripts in a linkset whenever the datastore has been modified through a call to one of the llLinksetData functions.

• integer action Action taken on the linkset Datastore
• string name The key of the name:value pair.
• string value The new value of the pair. Empty string if pair was deleted or is password-protected (see llLinksetDataWriteProtected).

This event fires in all scripts in a linkset whenever the datastore is changed.

Constant Description
LINKSETDATA_RESET 0 The linkset's datastore has been cleared by a call to llLinksetDataReset.
LINKSETDATA_UPDATE 1 A key in the linkset's datastore has been assigned a new value with llLinksetDataWrite
LINKSETDATA_DELETE 2 A key in the linkset's datastore has been deleted. Either through a call to llLinksetDataDelete or llLinksetDataWrite with an empty value.
LINKSETDATA_MULTIDELETE 3 A comma separated list of the keys in the linkset's datastore which have been deleted through a call to llLinksetDataDeleteFound.

Caveats


Examples

default
{
    linkset_data(integer action, string name, string value)
    {
        if (action == LINKSETDATA_RESET)
        {
            llOwnerSay("Link set datastore has been cleared.");
            // name and value will both be empty strings, ""
        }
        else if (action == LINKSETDATA_DELETE)
        {
            llOwnerSay("Link set datastore key \"" + name + "\" has been deleted.");
            // value is an empty string, ""
        }
        else if (action == LINKSETDATA_UPDATE)
        {
            llOwnerSay("Link set datastore key \"" + name + "\" = \"" + value + "\".");
        }
    }
}

Deep Notes

Signature

event void linkset_data( integer action, string name, string value );