Recursion
Recursion is a programming method in which a routine
calls itself. Recursion is an extremely powerful concept, but it can strain a
script's memory allocation.
subtractTillTwo(integer value) {
if (value > 2) {
subtractTillTwo(value - 1);
} else if (value == 2) {
llSay(0, "Value is two!");
}
}
default {
state_entry() {
subtractTillTwo(35);
}
}
To determine a script's memory usage:
llGetFreeMemory
script |
memory