Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Useful Subroutines Use_iif_on_LSL  

Use_iif_on_LSL

example:
integer x = iif( z<0 , -1 , +1 );
string hello = iif( sex == "M", "Man.", "Woman" );

Category: Useful Subroutines
By : vittorio.vais
Created: 2011-08-13 Edited: 2011-08-13
Worlds: Second Life

the Zip file

Download all files for Use_iif_on_LSL
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Use_iif_on_LSL_1.lsl
1 // include this lines in your scripts
2 integer iif(integer _cond, integer _true, integer _false){ if(_cond) return _true; else return _false; }
3
4 float iif( integer _cond, float _true, float _false){ if(_cond) return _true; else return _false; }
5
6 vector iif( integer _cond, vector _true, vector _false){ if(_cond) return _true; else return _false; }
7
8 list iif( integer _cond, list _true, list _false){ if(_cond) return _true; else return _false; }
9
10 string iif( integer _cond, string _true, string _false){ if(_cond) return _true; else return _false; }
11
12 rotation iif( integer _cond, rotation _true, rotation _false){ if(_cond) return _true; else return _false; }
13
14 key iif( integer _cond, key _true, key _false){ if(_cond) return _true; else return _false; }

Back to the Best Free Tools in Second Life and OpenSim.