Skip to content

llLinksetDataRead

string llLinksetDataRead(string name)

Returns the value stored for a key in the linkset.

Parameters
name (string)
Key to retrieve from the linkset's datastore.
  • If the name parameter is an empty string, this function returns an empty string
  • If the name:value pair was created with llLinksetDataWriteProtected, this function cannot read it and returns an empty string
  • Use llLinksetDataReadProtected with the correct passphrase to read protected data

Reading a value from the linkset datastore:

default {
state_entry() {
// Write a value first
llLinksetDataWrite("myKey", "myValue");
// Read it back
string value = llLinksetDataRead("myKey");
llSay(0, "Value: " + value);
}
}

Checking if a key exists by testing for empty string:

default {
state_entry() {
string value = llLinksetDataRead("someKey");
if (value == "") {
llSay(0, "Key not found or is empty");
} else {
llSay(0, "Found: " + value);
}
}
}

The llLinksetDataRead function only reads unprotected name:value pairs. For reading protected pairs, use llLinksetDataReadProtected with the appropriate passphrase. Both functions consume 10 energy and have no sleep time.