Skip to content
View in the app

A better way to browse. Learn more.

MagicDuel Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Loops In Mdscript - Solution Or Problem?

Featured Replies

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?

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.

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 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 :P

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Forum Statistics

  • Total Topics 17.5k
  • Total Posts 182.2k

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.