Infinite Looping regardless of loop parameters

Bugs will be moved here once resolved.

Post » Tue Dec 13, 2011 10:38 pm

I was working on learning arrays by programming a game that creates 15 sets of questions and answers from data in a db.

I added the plugin for Random Arrays, and maybe that is when it started, but I removed that plugin from this example, and it's still going crazy.

Please check Layout 2. It is a simple

For "test loop 2" from 1 to 3:
System | Set RandomNumber to int(random(0,31118))
txtRandomNumber |Set text to RandomNumber.

Instead of 3 loops, the loop goes on endlessly.

Layout 1 is basically everything I was coding but disabled as I tried to eliminate problems and add text boxes to watch my variables.

The capx is http://pennyhaynes.com/testgames/Array-INFINITE_LOOP.capx
B
3
G
1
Posts: 13
Reputation: 526

Post » Tue Dec 13, 2011 11:07 pm

@pennyhaynes: This URL leads me to a "page not found". :(
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Dec 14, 2011 12:01 am

My bad - forgot the Array folder

http://pennyhaynes.com/testgames/Array/Array-INFINITE_LOOP.capx
B
3
G
1
Posts: 13
Reputation: 526

Post » Wed Dec 14, 2011 1:21 am

The loop indeed goes endlessly since its run every tick.
I suggest you read again how events work, this should help you figure out yourself what's the better way to properly organize your event sheet.
If you want your loop to only run to 3, once, on start of the layout, put it as a subevent of the event "Start of layout". It will then just run once.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Wed Dec 14, 2011 2:09 am

I will definitely read your link. I have used for loops before without any issues. I guess I had used it as a subevent before though. Thank you so much for your patience with me.
B
3
G
1
Posts: 13
Reputation: 526


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests