在第一個階段中,條件中使用的資料必須變更,這樣步驟的數目才會是有限的。這項條件目的是結束區段的處理,而不繼續形成迴圈。在下列範例的步驟 5 中,條件是 teamList 變數不是空白。因此,只要對 teamList 變數輸入資料,就符合條件。當不再輸入資料時,即不符合條件,因此結束重複。
如果要讓查詢多次執行,請在迴圈儲存器內新增動態「資料來源配置」元素,來強制多次起始設定查詢。
var pos = teamList.indexOf( ",");
if ( pos >=0)
{
// get the first member ( till the first comma)
teamList.substr( 0, pos);
}
else
{
// last member
teamList;
}
var pos = teamList.indexOf( ",");
if ( pos >=0 && pos < teamList.length)
{
// get the first author ( till the first comma)
teamList.substr( pos + 1);
}
else
{
// last member, remove it
""
}