need some help .. Recently I've just created an array to calculate the value
function Calculate(){   
for(x=1;x<7;++x){
    var targetArr = [];
    for(i=0;i<3;i++){
        targetArr[i] = getComponent("product_"+x).getValue();
        targetArr[i] = getComponent("quantity_"+x).getValue();
        targetArr[i] = getComponent("stock_"+x).getValue();
    }
    var actualArr = [];
    for(i=0;i<3;i++){
        actualArr[i] = getComponent("actualProduct_"+x).getValue();
        actualArr[i] = getComponent("actualQuantity_"+x).getValue();
        actualArr[i] = getComponent("actualStock_"+x).getValue();
    }
    var achArr = [];
    for(i=0;i<3;++i){
        if((actualArr[i]>targetArr[i])||(targetArr[i]==0)||(targetArr[i]=="")||(targetArr[i]==null)){
            achArr[i] = 1;
        }else{
            achArr[i] = (actualArr[i] / targetArr[i]);
        }
        if(isNaN(achArr[i])){
            achArr[i] = 0;
        }
        x0 = achArr[i][x];
        x1 = achArr[i][x];
        x2 = achArr[i][x];
    }
    value = 100;
    currentDocument.replaceItemValue("achProduct_"+x, x0*Value);
    currentDocument.replaceItemValue("achQuantity_"+x, x1*Value);
    currentDocument.replaceItemValue("achStock_"+x, x2*Value);
}}
but when i run the script, its got forever looping on my lotus domino server and when i try to restart the web server its stucked and i have to force closed the server, and manually open it again
anyone can help me to solve my case ? i just need to display the achArr values
 
    