Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By Mmiscool
#47138 If you refresh the page and the device is in a wait state the returned page will reflect what is currently in the buffer.

I still might no be understanding the goal here. This lets you return the page in the html buffer and continue merrily executing code.

For example you could do this. print a msg about how the device is restarting and then execute the reboot command . You will see the msg that it is rebooting in the browser and the device will happily reboot. No browser trying to fetch the page until it gives a page not found error.
User avatar
By Electroguard
#47142 Yes sir, you understand ok, it's to send a msg to the browser but then continue on to do something local before getting caught up 'WAIT'ing for events. And your implementation is much better than having to escape the wait using a timeout jump.

When I first tried A24 I just did a reflash. But I had all sorts of weird problems and then ended up with a corrupt script, so I've just done a reformat first then the reflash, and now things seem to working ok ... including the new 'returngui' command only displaying the single print line as in the example.

Thanks.
User avatar
By Electroguard
#47147 You can see what I'm trying to do here, but I still can't make it happen.
Is there any way to accomplish this?

Code: Select allprint "Booting up, be patient"  '  print an initial startup msg
returngui
delay 3000   ' do some startup routines like blink out the local ip address

cls
print "Ready and waiting"  ' display normal working screen with buttons etc and wait for events
wait
User avatar
By Mmiscool
#47149 I see where you are going with this but it will be difficult to implement some thing like this.

The interpreter is normally either running code or in a wait state that it can respond to browser requests. The problem is that if some one clicks a button and the device is always returning the page or at least checking for http request once per line of of code execution you could end up with a jump. while you are in the middle of some thing.

If you click a button and are in the middle of a sub routine I think things could get out of hand real quick.