これはトリプル配列ルーパーの例です(静的変数を使用しているため、変化することがわかります)
これは私が作成したカスタムです。インクリメンタル変数 (カウンターなど) を格納するための構文に注意してください。
このルーパーは、すべてのオプションを循環します (下の例では、6*5*4=120 のオプションがあります)。各オプションを一度エコーアウトしてから、次のオプションに移動します。
example_array_looper
storeEval new Date().getTime(); timeStart
echo ${timeStart}
storeEval new Array("1","2","3","4"); toparray
storeEval new Array("A", "B", "C", "D", "E"); middlearray
storeEval new Array("i","ii","iii","iv","v","vi"); bottomarray
getEval topindex=0;
getEval middleindex=0;
getEval bottomindex=0;
getEval loopCounter=0;
while topindex < storedVars['toparray'].length
storeEval topindex temptop
while middleindex < storedVars['middlearray'].length
storeEval middleindex tempmiddle
while bottomindex < storedVars['bottomarray'].length
storeEval bottomindex tempbottom
echo javascript{storedVars['toparray'][storedVars['temptop']]+" -> "+storedVars['middlearray'][storedVars['tempmiddle']]+" -> "+storedVars['bottomarray'][storedVars['tempbottom']]}
getEval bottomindex++;
getEval loopCounter++;
endWhile
getEval bottomindex=0;
getEval middleindex++;
endWhile
getEval bottomindex=0;
getEval middleindex=0;
getEval topindex++;
endWhile
storeEval loopCounter loops
echo Total number of loops is: ${loops}
storeEval new Date().getTime(); timeEnd
echo ${timeEnd}
storeEval (${timeEnd}-${timeStart})/1000 scriptRunTime
echo Total Run Time for Script was: ${scriptRunTime}s
storeEval ${scriptRunTime}/${loops} averageTime
echo Average Loop Duration was: ${averageTime}s
私はすべての html タグ付けを削除することにしました (そのため、ギャップは非常に明白なはずです)。StoreEval コマンドは、2 ステップではなく 1 ステップでインクリメンタルとして使用できるため、ループ カウンターを保持するのに最適です。