Content deleted Content added
m Rollback edit(s) by 174.251.135.39 (talk): Unexplained content removal (RW 16.1) |
→Handling nil results: fixes |
||
Line 106:
To get the binary <syntaxhighlight lang="lua" inline>true/false</syntaxhighlight>-only values, use code like:
<syntaxhighlight lang="lua">
myvariable = yesno(value
myvariable = yesno(value
myvariable = yesno('foo') or false -- Unknown string returns nil, result is false.
myvariable = yesno('foo', true) or false -- Default value (here: true) applies, result is true.
|