Difference between revisions of "While/ja"

From Second Life Wiki
Jump to navigation Jump to search
(cats)
(LSOの場合について追加)
Line 36: Line 36:
|also_articles
|also_articles
|also_footer
|also_footer
|notes={{LSLG|do-while}} のループは while ループや {{LSLG|for/ja|for}} ループより速いです。
|notes={{LSLG|do-while/ja|do-while}} のループは while ループや {{LSLG|for/ja|for}} ループより LSO においては速いです。
|mode
|mode
|deprecated
|deprecated

Revision as of 01:36, 21 February 2013

while( conditionloop

•  condition これが実行されてtrueであれば loop が実行されます。
•  loop シングルステートメントでもブロックステートメントでも空のステートメントのいずれも可能です。


いずれのステートメントが空でも可能です。

詳細

条件の種類
条件
integer 0ではない場合は真。
float 0ではない場合は真。
string 文字列の長さが0ではない場合は真。
key keyが有効でNULL_KEYではない場合のみ真。
vector vectorがZERO_VECTORではない場合は真。
rotation rotationがZERO_ROTATIONではない場合は真。
list listの長さが0ではない場合は真。正しい動作は、Monoでコンパイルされたスクリプトのみで見られ、LSOでコンパイルされたスクリプトは誤って false になります。BUG-230728


//シングルステートメント
integer a = 0;
integer b = 10;
while(a < b)
    llOwnerSay((string)(a++));
//ブロックステートメント
integer a = 0;
integer b = 10;
while(a < b)
{
    llOwnerSay((string)a);
    ++a;
}
//空のステートメント
integer a = 0;
integer b = 10;
while(a++ < b);

ノート

do-while のループは while ループや for ループより LSO においては速いです。