How do you handle the new alert() MessageBox ?

As a newbie and having been away from codea for the last two months or so I just updated the app and see that there is now a MessageBox available. How do you suggest I call it? It seems to go into an endless loop if at the moment.
It’s a bit of a dumb question but I am still trying to get my head around the code in general.
Thanks everyone in advance

Hello, and welcome to the forums.
If you put it in the draw loop, it means that Codea is trying to make an alert every frame. Try making it a one-time call. There is no way to handle these alerts. Hope that helps!

Hi @dolbs,

One of the first things I tried and drove me round the twist, as I’d put the alert in the draw() function.

This is covered by an entry in references (I think under touch as that is where the example is placed.

I don’t feel this is set up properly - I tried to capture an input using

  ans = alert("Press the key")

But ans is returned as nil. For the future I think this should return a value so that when dialogue boxes are added you can use it in the input cycle. I suggest a function dialogue(). Apple must have this built in the OS.

I only see me using this as a means to check user input by displaying messages for development only.

Bri_G

:slight_smile:

Thanks to all.

The alert() was in the draw section. I have now moved it and it is now working as it should.
Dolbs