vikaspa

07-14-2004, 03:43 AM

Dear All

I have a typical problem

I have am accepting qty and value and deriving amount

There are say 6 such values and I had defined the variable names as follow

qty0 rate0 amt0

qty1 rate1 amt1

qty2 rate2 amt2

qty3 rate3 amt3

qty4 rate4 amt4

qty5 rate5 amt5

qty6 rate6 amt6

I want to use for loop to derive amt

I tried by passing the counter (0,1,2,3,4 ) to a function say calcval

function calval(cntr) {

q = 'qty"+cntr+"';

r='rate"+ntr+"';

val=q * r;

}

Indeed this is not working !

Thanks in advance for help extended by you .

I really admire your efforts !

I have a typical problem

I have am accepting qty and value and deriving amount

There are say 6 such values and I had defined the variable names as follow

qty0 rate0 amt0

qty1 rate1 amt1

qty2 rate2 amt2

qty3 rate3 amt3

qty4 rate4 amt4

qty5 rate5 amt5

qty6 rate6 amt6

I want to use for loop to derive amt

I tried by passing the counter (0,1,2,3,4 ) to a function say calcval

function calval(cntr) {

q = 'qty"+cntr+"';

r='rate"+ntr+"';

val=q * r;

}

Indeed this is not working !

Thanks in advance for help extended by you .

I really admire your efforts !