Performs a memory operation on a specified RAM memory bank.
Response: After the memory bank has processed the system call, it will respond with BIOS_RAM_RESP.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", [operation]
);
• target | LINK_ROOT |
• integer | [memory_bank] |
• key | [operation] |
Parameter | Description |
---|---|
[memory_bank] |
Integer. Must be a [memory_bank] number. The operation will be performed on this memory bank. |
[operation] |
Pipe-delimited ("|") list cast as string. Must be the operation to perform on this memory bank. The format of this parameter varies depending on the command used. See below for more information. |
The [operation]
parameter is a pipe-delimited ("|") list. The general format is "[command]
|[subparameters...]
". Possible commands are as follows:
Command | Format |
---|---|
"C" (Change Case) | "C|" + [user] + "|" + [request_id] + "|" + [start] + "|" + [end] + "|" + [mode] |
"D" (Delete) | "D|" + [user] + "|" + [request_id] + "|" + [start] + "|" + [end] |
"I" (Insert/Overwrite) | "I|" + [user] + "|" + [request_id] + "|" + [index] + "|" + [overwrite] + "|" + [data] |
"L" (Length) | "L|" + [user] + "|" + [request_id] |
"P" (Pad) | "P|" + [user] + "|" + [request_id] + "|" + [length] + "|" + [add_start] + "|" + [add_end] |
"R" (Read) | "R|" + [user] + "|" + [request_id] + "|" + [start] + "|" + [end] + "|" + [target] |
"T" (Trim) | "T|" + [user] + "|" + [request_id] + "|" + [start] + "|" + [end] + "|" + [trim_type] |
"V" (Version) | "V|" + [user] + "|" + [request_id] |
"W" (Write) | "W|" + [user] + "|" + [request_id] + "|" + [data] |
"X" (Index) | "X|" + [user] + "|" + [request_id] + "|" + [start] + "|" + [end] + "|" + [needle] |
"Y" (Replace) | "Y|" + [user] + "|" + [request_id] + "|" + [start] + "|" + [end] + "|" + [needle] + "|" + [replacement] + "|" + [limit] |
For all operations, the following subparameters are required:
Subparameter | Description |
---|---|
[user] |
String. Must be the [user] that was sent with BIOS_RAM_ALLOCATE to allocate the selected memory bank. |
[request_id] |
String. Must be a string, up to 64 characters, that will be returned with BIOS_RAM_RESP. Can be any value, or left blank. Does not need to be unique. |
A "C" (Change Case) operation performs llToUpper or llToLower on a specified subset of the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "U|" + [user]
+ "|" + [request_id]
+ "|" + [start]
+ "|" + [end]
+ "|" + [mode]
);
Acts like: memory = llGetSubString(memory, 0, [start]
- 1) + llToUpper(llGetSubString(memory, [start]
, [end]
) + llGetSubString(memory, [end]
+ 1, -1));
This comparison assumes [start]
and [end]
are both positive integers - the memory bank will adapt to compensate for zero and negative indexes. This comparison also assumes [mode]
is set to "U".
Subparameter | Description |
---|---|
[start] |
Integer cast as string. Must be the start index of the substring to run llToUpper on. May be positive, negative, or zero; negative values are counted from the end of the memory bank. Note that llToUpper does not have built-in substring parameters; this operation first calls llGetSubString, then runs llToUpper on the resulting string and stitches it back into the original string in memory at the specified range. |
[end] |
Integer cast as string. Must be the end index of the substring to run llToUpper on. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
[mode] |
String. Must be either "U" for llToUpper or "L" for llToLower. |
To change the case of the entire string, use [start]
of 0 and [end]
of -1.
A "D" (Delete) operation performs llDeleteSubString on the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "D|" + [user]
+ "|" + [request_id]
+ "|" + [start]
+ "|" + [end]
);
Acts like: memory = llDeleteSubString(memory, [start]
, [end]
);
Subparameter | Description |
---|---|
[start] |
Integer cast as string. Must be the start index to pass to llDeleteSubString. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
[end] |
Integer cast as string. Must be the end index to pass to llDeleteSubString. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
To delete the entire string, use [start]
of 0 and [end]
of -1. (You can also use a "W" (Write) operation with a blank [data]
subparameter in that case.)
An "I" (Insert) operation performs llInsertString on the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "I|" + [user]
+ "|" + [request_id]
+ "|" + [index]
+ "|" + [overwrite]
+ "|" + [data]
);
Acts like: memory = llInsertString(memory, [index]
, [data]
);
Subparameter | Description |
---|---|
[index] |
Integer cast as string. Must be the index to insert [data] at in the memory string.May be positive, negative, or zero. Negative values are counted from the end of the memory bank and the insert operation will occur after the specified index instead of before the specified index (even though llInsertString does not support negative values). |
[overwrite] |
Boolean cast as integer cast as string. Must be either 0 or 1. If set to 0, the memory bank will insert the data into the existing data at the specified index, shifting the existing data to the right by the length of [data] and erasing any data that exceeds the memory bank limit.If set to 1, the memory bank will overwrite existing data in memory at the specified index for the length of [data] . |
[source] |
String. Must be a blank string. |
[data] |
String. Must be the new string data to insert into the memory string. |
To append data to the end of existing data in the memory bank, use [index]
of -1. To append data to the start, use [index]
of 0.
To append data repeatedly to either end (or both) until a specified length is reached, use a "P" (Pad) operation instead.
To overwrite all existing data in the memory bank, erasing all existing data, use a "W" (Write) operation instead.
To overwrite only specific instances of a string (find & replace), use a "Y" (Replace) operation instead.
A "L" (Length) operation reads the length of the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "L|" + [user]
+ "|" + [request_id]
);
Acts like: llStringLength(memory);
A "P" (Pad) operation repeatedly pads the string in memory until it matches or exceeds the specified length.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "P|" + [user]
+ "|" + [request_id]
+ "|" + [length]
+ "|" + [add_start]
+ "|" + [add_end]
);
Acts like: while (llStringLength(memory) < [length]
) memory = [add_start]
+ memory + [add_start]
;
Subparameter | Description |
---|---|
[length] |
Integer cast as string. Must be the target length to reach before the operation ceases. Note that if more than a single character is sent in [add_start] and [add_end] combined, or if the string in memory already exceeds the target length, the resulting string may exceed the target length. |
[add_start] |
String. Must be the characters to add to the start of the string in memory on each padding cycle. May be a blank string only if [add_end] is not also a blank string. |
[add_end] |
String. Must be the characters to add to the end of the string in memory on each padding cycle. May be a blank string only if [add_start] is not also a blank string. |
The padding cycle runs approximately 64 times per second in testing irrespective of the length of [add_start]
or [add_end]
. Therefore, when filling large amounts of memory with a padding value (such as a blank space), it is more efficient to use large strings for [add_start]
and/or [add_end]
to speed things up. For example, using only an [add_end]
value of just one space (" ") takes about two minutes to fill 8192 characters of memory, whereas using 128 spaces takes only about one second.
An "R" (Read) operation reads a segment of the string in memory and sends it in the BIOS_RAM_RESP response or writes/inserts it into another memory bank.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "R|" + [user]
+ "|" + [request_id]
+ "|" + [start]
+ "|" + [end]
+ "|" + [target]
);
Acts like: llGetSubString(memory, [start]
, [end]
);
Subparameter | Description |
---|---|
[start] |
Integer cast as string. Must be the start index of the range of the string in memory to read. May be positive, negative, or zero; negative values are counted from the end of the memory bank. This operation first calls llGetSubString on the string in memory, then reads only the resulting substring. |
[end] |
Integer cast as string. Must be the end index of the range of the string in memory to read. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
[target] |
Colon-delimited (":") list cast as string. Must be one of the following: • A blank string: Returns the read data directly in BIOS_RAM_RESP. • "ram:" + [mode] + ":" + [memory_bank] + ":" + [user] + ":" + [index] [mode] must be either "W" (Write) or "I" (Insert).[memory_bank] must be the memory bank number to write to.[user] must be the [user] parameter passed when allocating [memory_bank] .[index] must be the [index] passed in an "I" (Insert) operation if [mode] is "I"; otherwise it is ignored.For example, "ram:W:1:" + [user] + ":0" would write the read data to memory bank 1 (overwriting everything)."ram:I:2:" + [user] + ":-1" would append the read data to the end of memory bank 2.• "ldfs:" + [sub_subparameters] For internal use only. See BIOS_DISK_OP instead. • "sdti:" + [sub_subparameters] For internal use only. See BIOS_SDTI_OUT instead. |
Only specify an empty string as
[target]
if you are absolutely sure the length of the returned data is small enough to not crash any running software. Generally, you should avoid requesting more than 1024 characters at a time this way.
To read the entire string, use [start]
of 0 and [end]
of -1.
A "T" (Trim) operation performs llStringTrim on a specified subset of the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "T|" + [user]
+ "|" + [request_id]
+ "|" + [start]
+ "|" + [end]
+ "|" + [trim_type]
);
Acts like: memory = llGetSubString(memory, 0, [start]
- 1) + llStringTrim(llGetSubString(memory, [start]
, [end]
), [trim_type]
) + llGetSubString(memory, [end]
+ 1, -1));
This comparison assumes [start]
and [end]
are both positive integers - the memory bank will adapt to compensate for zero and negative indexes.
Subparameter | Description |
---|---|
[start] |
Integer cast as string. Must be the start index of the range of the string in memory to read and trim. May be positive, negative, or zero; negative values are counted from the end of the memory bank. This operation first calls llGetSubString on the string in memory, then trims only the resulting substring and overwrites the original range of the string in memory with the trimmed string. Note that the resulting length of the string in memory may change. |
[end] |
Integer cast as string. Must be the end index of the range of the string in memory to read and trim. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
[trim_type] |
Integer cast as string. Must be the trim type constant sent to llStringTrim (either 1 to trim the start, 2 to trim the end, or 3 to trim both). |
To trim the entire string, use [start]
of 0 and [end]
of -1.
A "V" (Version) operation reads the memory bank version number, which can be used to check if the memory bank supports future added operations.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "V|" + [user]
+ "|" + [request_id]
);
A "W" (Write) operation writes the provided data to the string in memory, overwriting and deleting any existing data.
Acts like: memory = [data]
;
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "W|" + [user]
+ "|" + [request_id]
+ "|" + [data]
);
Subparameter | Description |
---|---|
[data] |
String. Must be the new string data to store as the memory string. |
An "X" (Index) operation performs llSubStringIndex on a specified subset of the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "X|" + [user]
+ "|" + [request_id]
+ "|" + [start]
+ "|" + [end]
+ "|" + [needle]
);
Acts like: llSubStringIndex(llGetSubString(memory, [start]
, [end]
), [needle]
);
Subparameter | Description |
---|---|
[start] |
Integer cast as string. Must be the start index of the range of the string in memory to index. May be positive, negative, or zero; negative values are counted from the end of the memory bank. This operation first calls llGetSubString on the string in memory, then indexes only the resulting substring. Note that if [start] is non-zero, the resulting index will be only for the specified substring, not the entire memory string. For example, if [start] is 3 and the index operation is called on a string in memory of "ABCDEFG" with [needle] of "EFG", the resulting index will be 1, not 4. |
[end] |
Integer cast as string. Must be the end index of the range of the string in memory to index. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
[needle] |
String. Must be the characters to search for using llSubStringIndex. |
To index the entire string, use [start]
of 0 and [end]
of -1.
A "Y" (Replace) operation performs llReplaceSubString on a specified subset of the string in memory.
llMessageLinked(LINK_ROOT, [memory_bank]
, "BIOS_RAM_OP", "Y|" + [user]
+ "|" + [request_id]
+ "|" + [start]
+ "|" + [end]
+ "|" + [needle]
+ "|" + [replacement]
+ "|" + [count]
);
Acts like: memory = llGetSubString(memory, 0, [start]
- 1) + llReplaceSubString(llGetSubString(memory, [start]
, [end]
), [needle]
, [replacement]
, [count]
) + llGetSubString(memory, [end]
+ 1, -1));
This comparison assumes [start]
and [end]
are both positive integers - the memory bank will adapt to compensate for zero and negative indexes.
Subparameter | Description |
---|---|
[start] |
Integer cast as string. Must be the start index of the range of the string in memory to index. May be positive, negative, or zero; negative values are counted from the end of the memory bank. This operation first calls llGetSubString on the string in memory, then performs llReplaceSubString only on the resulting substring, then replaces the original segment of the string in memory with the replaced segment. |
[end] |
Integer cast as string. Must be the end index of the range of the string in memory to index. May be positive, negative, or zero; negative values are counted from the end of the memory bank. |
[needle] |
String. Must be the string that will be replaced using llReplaceSubString. Since this subparameter cannot accept a pipe ("|") character, if this subparameter is left blank, it will automatically be converted into "|". |
[replacement] |
String. Must be the string that instances of [needle] will be replaced with using llReplaceSubString.Since this subparameter cannot accept a pipe ("|") character, if this subparameter is left blank, it will automatically be converted into "|". |
[count] |
Integer cast as string. Must be the "count" value used in llReplaceSubString. To replace all instances of [needle] with [replacement] , use 0.To replace only a certain number of instances of [needle] from the left/start of the string in memory, use a positive integer.To replace only a certain number of instances of [needle] from the right/end of the string in memory, use a negative integer. |
To replace all instances of [needle]
in the entire string, use [start]
of 0, [end]
of -1, and [count]
of 0.
This operation may cause the contents of the memory bank to grow or shrink in size if the sizes of
[needle]
and[replacement]
do not match. If the results exceed the maximum capacity of the memory bank, any excess will be trimmed from the end of the return value of llReplaceSubString. If the results exceed the memory capacity of the LSL script itself, the memory bank will crash and will be inaccessible until replaced using memory repair software. Therefore, it is strongly recommended to set[count]
to a safe non-zero value when the length of[replacement]
exceeds[needle]
.
[user]
values for allocated memory banks