Difference between revisions of "LlEval"
Jump to navigation
Jump to search
m |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{LSL_Function | |||
|func=llEval | |||
|func_id | |||
|func_sleep=0.0 | |||
|func_energy=0.0 | |||
|func_desc= | |||
|func_footnote | |||
|return_type=integer | |||
integer | |return_text=to see the success of eval´d code.<br> -1 = Parse error in Eval´d code <br>0 = Success, but without return in Eval´d code | ||
|p1_type=string|p1_name=code|p1_desc=a string with different LSL-functions|p1_hover | |||
|constants= | |||
|spec | |||
|caveats | |||
|examples= | |||
<lsl> | <lsl> | ||
default | default | ||
{ | { | ||
state_entry() | state_entry() | ||
{ | { | ||
string code = "llOwnerSay(\"Hello World\");"; | |||
if( llEval(code) != -1 ) | |||
if ( | |||
{ | { | ||
llOwnerSay("...it works !!! Try now more complex :"); | |||
llOwnerSay((string)llEval("llOwnerSay(\" must be 23\"); return 23;")); | |||
} | } | ||
llOwnerSay(" | else | ||
{ | |||
llOwnerSay("Parse Error in Eval´d code"); | |||
} | |||
} | } | ||
// Output : | |||
// Hello World | |||
// ...it works !!! Try now more complex : | |||
// 23 must be 23 | |||
} | } | ||
</lsl> | </lsl> | ||
|helpers | |||
|also_header | |||
|also_functions | |||
|also_tests | |||
|also_events | |||
|also_articles | |||
|also_footer | |||
|notes=With this function its now possible to write code more dynamic. You can read your functions from a Notecard, external WEB-page and much more...<br>Vote for this function at :{{Jira|SVC-1671}} | |||
|mode=request | |||
|deprecated | |||
|location | |||
|cat1 | |||
|cat2 | |||
|cat3 | |||
|cat4 | |||
|cat5 | |||
|cat6 | |||
}} |
Latest revision as of 02:19, 5 May 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
LSL Feature Request | |
The described function does not exist. This article is a feature request. |
Summary
Function: integer llEval( string code );REQUEST | Function ID |
0.0 | Forced Delay |
0.0 | Energy |
Returns an integer to see the success of eval´d code.
-1 = Parse error in Eval´d code
0 = Success, but without return in Eval´d code
• string | code | – | a string with different LSL-functions |
Caveats
Examples
<lsl> default {
state_entry() { string code = "llOwnerSay(\"Hello World\");"; if( llEval(code) != -1 ) { llOwnerSay("...it works !!! Try now more complex :"); llOwnerSay((string)llEval("llOwnerSay(\" must be 23\"); return 23;")); } else { llOwnerSay("Parse Error in Eval´d code"); } }
// Output : // Hello World // ...it works !!! Try now more complex : // 23 must be 23
}
</lsl>Notes
With this function its now possible to write code more dynamic. You can read your functions from a Notecard, external WEB-page and much more...
Vote for this function at :SVC-1671