?
This document uses PHP Chinese website manual Release
JScript? | 語言參考 |
返回一個(gè) Boolean 值,指明枚舉算子是否位于集合的末尾。
myEnum.atEnd()
必選項(xiàng) myEnum 參數(shù)是任意 Enumerator 對(duì)象。
如果當(dāng)前項(xiàng)是集合中的最后一個(gè),或者集合為空,或者當(dāng)前項(xiàng)沒有定義,那么 atEnd 方法將返回 true 。否則返回 false 。
在下面的代碼中,使用了 atEnd 方法來決定是否到達(dá)了一個(gè)驅(qū)動(dòng)器列表的末尾:
function ShowDriveList(){
???var fso, s, n, e, x;
???fso = new ActiveXObject("Scripting.FileSystemObject");
???e = new Enumerator(fso.Drives);
???s = "";
???for (; !e.atEnd(); e.moveNext())
???{
??????x = e.item();
??????s = s + x.DriveLetter;
??????s += " - ";
??????if (x.DriveType == 3)
?????????n = x.ShareName;
??????else if (x.IsReady)
?????????n = x.VolumeName;
??????else
?????????n = "[
驅(qū)動(dòng)器未就緒]";
??????s +=???n + "<br>";
???}
???return(s);
}
版本 2
item 方法 | moveFirst 方法 | moveNext 方法
應(yīng)用于: Enumerator 對(duì)象