While/ja

From Second Life Wiki
< While
Revision as of 20:08, 12 December 2007 by Coffee Mills (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

while( 条件式ループ

•  条件式 これが実行され真であれば ループ が実行される.
•  ループ 単文でも複合文でも空文でもよい.


どちらの文も空文でもよい.

詳細

条件の種類
条件
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 ループより速い.