Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] WhileEndwhile loop crashes program (agkmobile)

Author
Message
Zandy
2
Years of Service
User Offline
Joined: 26th Nov 2021
Playing:
Posted: 26th Nov 2021 12:25
I'm using appgamekit mobile

It seems any instance of a while loop inside a do loop crashes the agk app

i.e.

A=1
Do
While a=1
Print(1234)
Endwhile
Sync()
Loop




Any clarification would be much appreciated

The author of this post has marked a post as an answer.

Go to answer

Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 26th Nov 2021 14:52 Edited at: 26th Nov 2021 14:55
This post has been marked by the post author as the answer.
That won't crash AGK.
I suspect what you really mean is you just see a black screen and you are expecting to see 1234 right?
The reason you only see a black screen is because you need to call sync() to update the display and that code will never call sync().
Try moving it inside the loop like this:

or maybe you don't want the additional inner loop at all?
Like this:
Zandy
2
Years of Service
User Offline
Joined: 26th Nov 2021
Playing:
Posted: 27th Nov 2021 01:11
Ohhhh I see. Ty very much
It's awesome that you guys take the time to get on here and hold the innumerable hands of noobs

Login to post a reply

Server time is: 2024-04-19 17:30:43
Your offset time is: 2024-04-19 17:30:43