umen
11-11-2002, 07:39 PM
Hello
i wander say if i have main function that using or more likely to say reusing some groups of lines of code
over and over again because of many local variables that the main function using .
now my question is can i make some kind of "sub" function (its not have to be "real" function " )
that will be inside the main function and will be abele to use the local variables BUT and that i could
call this "sub" function from inside the main function .
something like this : (pasado)
function MAIN()
{
var foo1
var foo2
function SUB(){
..do stuff with local var's foo1 or foo2
}
if (...) {
call SUB ()
}else {
call SUB ()
}
}
ok i hope you got my point here..
thanks!
i wander say if i have main function that using or more likely to say reusing some groups of lines of code
over and over again because of many local variables that the main function using .
now my question is can i make some kind of "sub" function (its not have to be "real" function " )
that will be inside the main function and will be abele to use the local variables BUT and that i could
call this "sub" function from inside the main function .
something like this : (pasado)
function MAIN()
{
var foo1
var foo2
function SUB(){
..do stuff with local var's foo1 or foo2
}
if (...) {
call SUB ()
}else {
call SUB ()
}
}
ok i hope you got my point here..
thanks!