learner
9th January 2003, 09:54
For Loop basic question
I have about 20 item fields on form, the name of the form fields are
mitm.1
mitm.2
mitm.3
mitm.4
..........
.......
......
....
...
mitm.20
having domain as tcitem
now i want to clear all the fields using a for loop
so i wrote
field.mitm.2:
before.input:
if isspace(mitm.1) then
cle(2)
attr.input = false
endif
|********************* function section ****************
functions:
function cle(long a)
{
for tm = a to 4
mitm.tm = ""
endfor
}
It gives me the followng error Unresol;ved reference to function mitm
the error i undertood since mitm.tm is not an array, but how do i clear all these fields with a for loop, rather than clearing fields individually ...........????
Please not that i would not like to declared mitm field as array, since i am customizing a session which is already very complicated and it has used these variables .
I have about 20 item fields on form, the name of the form fields are
mitm.1
mitm.2
mitm.3
mitm.4
..........
.......
......
....
...
mitm.20
having domain as tcitem
now i want to clear all the fields using a for loop
so i wrote
field.mitm.2:
before.input:
if isspace(mitm.1) then
cle(2)
attr.input = false
endif
|********************* function section ****************
functions:
function cle(long a)
{
for tm = a to 4
mitm.tm = ""
endfor
}
It gives me the followng error Unresol;ved reference to function mitm
the error i undertood since mitm.tm is not an array, but how do i clear all these fields with a for loop, rather than clearing fields individually ...........????
Please not that i would not like to declared mitm field as array, since i am customizing a session which is already very complicated and it has used these variables .