I am trying to use the boolean (which I guess we have to use in ineger types?) return of a function in a logical operation (if A and B)
I'm getting a Math Error now.
The script compiles fine in the editor "pre-flight", the error occurs when trying to run this function.
I'm still new to this SL Script FrankenLanguage, so I'm not sure where the problem is O_o
FWIW, I've tried using 1 and 0 as the return values. It looks like "TRUE" and "FALSE" are just constants representing 1 and 0 respectively, so I wouldn't expect that to be an issue.
Of course I started out trying to use "boolean" as the return type, but that gave me a syntax error.
integer beginsWith(string str, string substr){
integer ss_length = llStringLength(substr);
if(llGetSubString(str, 0, ss_length) == substr)
return TRUE;
return FALSE;
}
...
if(ItemType == INVENTORY_SOUND && beginsWith(ItemName, "Radio: ")){}
How do I use a supposed-to-be boolean in a logical operation?