Vladdy
11-18-2002, 01:25 PM
Hi all,
Would like to hear your opinions on this one:
say I have a variable that is updated using some onclick event and I want to have a loop where I wait for this variable to be set to some value. What do I do inside the loop that will allow to process user input and not hang the browser?
variable = 0
while (variable!=5)
{
// do something here that will allow another function
// envoked by some event to change the variable
}
Consider it a theoretical problem (do not ask me what I'm trying to do, 'cause I'm aware or other approaches)
Regards
Would like to hear your opinions on this one:
say I have a variable that is updated using some onclick event and I want to have a loop where I wait for this variable to be set to some value. What do I do inside the loop that will allow to process user input and not hang the browser?
variable = 0
while (variable!=5)
{
// do something here that will allow another function
// envoked by some event to change the variable
}
Consider it a theoretical problem (do not ask me what I'm trying to do, 'cause I'm aware or other approaches)
Regards