project works with "run" but does not work in browsers - Forum

Forum Navigation
Climate strike banner
You need to log in to create posts and topics.

project works with "run" but does not work in browsers

Is it possible that a project runs well within VisualNeo, but does not in browsers? (And as I remember a month ago it worked in browsers well, but now it refused to work.) I deleted the unnecessary pages and put the problematic one first (grafikon). Unfortunately it is in Hungarian. Anyone can help? Thanks a lot. (this is an animated cpv analysis graph) here it is.

Hi @info1,

The problem are in your while loops.

I'm afraid it's not a good idea to use the Delay command inside any kind of loop.
In JavaScript it is not possible to stop the execution of a script and although Dave provided a method to do it (personally I don't like it), it is only reliable in simple situations, not within a loop.

It is much better to use Wait ... EndWait instead or even SetTimeOut.
I know this way it's a bit more complicated, but it's the right way to do it since any other system will freeze the user interface for sure.



I've found the problem. It was not the delay command, but the following in a While-EndWhile loop:

While [count] < 9


   While [mehet] != "tovabb"
      ShowObject "nyomogomb" "" 0
   HideObject "nyomogomb" "" 0
   SetVar [mehet] ""


   SetVar [count] [count]+1



When user pushes the button, SetVar [mehet] "tovabb".

Here I wanted to wait until user pushes the button "nyomogomb".  Is it any solution to wait for a "button-push" in a loop? Thanks.

Sorry, as far as I know, in JavaScript there is no way to make a loop to wait without freezing the user interface.
I don't understand very well why you need that, but there is for sure an alternative way to achieve the same result, perhaps using a Timer.