Fyrd Argentus Posted October 12, 2010 Report Posted October 12, 2010 I have a coding problem (details below) I could solve with an infinite loop but that would not only be wasteful, it could also contribute to the internet delays we are experiencing. Are others already using this technique, and is that perhaps why we are seeing internet hangs? What I want to do is have the code progress to a point, wait for user input, then proceed. I have code with a "submit" type button in one clickie that has no reporting, which executes the entire page, sweeping past the null-entry of the submit button. When you hit it, the entire page of code executes again, this time using the entry. I have code with a "submit" type button in another clickie that has reporting. When you hit submit, it sends the report and the window basically crashes or freezes so you must F5 out. The red-flag solution is to have an infinite loop that keeps checking for user input. Only then does it move on. I guess a better solution when I figure out how to do this is to have code block A execute if entry is null, block B execute if entry by user. In the old days, mainframes had time-out limits to protect against infinite loops like this. Is this a genuine concern? Is this maybe why we are getting internet hangs - infinite loops waiting for user input on clickies? Quote
Burns Posted October 12, 2010 Report Posted October 12, 2010 would simple if-s do? like, [pseudo code] if (input=first answer) echo @content[1]; else echo @content[0]; if (input=second answer) echo @content[2]; else echo @content[0]; That's how i'm running the signpost in MDP, so the getting hands on the actual code would be quite easy. If that's helpful for you, that is. Quote
Rendril Posted October 12, 2010 Report Posted October 12, 2010 I'm not sure how you are waiting for user input in mdscript, it if either when the script is run or it isn't, there is no in-between waiting for input. Like Burns said, is if-statements to detect which input was given. As for infinite loops, the script is only given a finite execution time. Imagine if 200 users had infinite loops running on the server Quote
Laphers Posted October 14, 2010 Report Posted October 14, 2010 [quote name='Fyrd Argentus' timestamp='1286894081' post='70202'] I guess a better solution when I figure out how to do this is to have code block A execute if entry is null, block B execute if entry by user. [/quote] It looks to me like you already know that you have to use if/then blocks I'm not planning any code right now so if you would like me to look at your actual code, I might be able to help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.