Kenhardwick
Programmer
I have say five variables named, field1,field2,field3,field4 and field5.
And, I want to loop thru those five variables and want to do so thru code, like...
field1 = 5
field2 = 1
field3= 3
field4= 4
field5 3
total= 0
For cnt = 1 to 5
nextField = field & cnt
Total = Total + newfunction(nextField)
next
NewFunction(nextfield)
NewFunction = ???? value of the variable as indicated by the string passed...
(such as if nextfield = field1 then what is the value of
field1..ie 5)
end function
Would like to know if there is a way to write this "newfunction" such that it would return the value of
the variable named in the string passed...
Thanks for help on how to do this or any suggested other ways...Ken Hardwick,Norman,Ok
And, I want to loop thru those five variables and want to do so thru code, like...
field1 = 5
field2 = 1
field3= 3
field4= 4
field5 3
total= 0
For cnt = 1 to 5
nextField = field & cnt
Total = Total + newfunction(nextField)
next
NewFunction(nextfield)
NewFunction = ???? value of the variable as indicated by the string passed...
(such as if nextfield = field1 then what is the value of
field1..ie 5)
end function
Would like to know if there is a way to write this "newfunction" such that it would return the value of
the variable named in the string passed...
Thanks for help on how to do this or any suggested other ways...Ken Hardwick,Norman,Ok