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.

AppGameKit Classic Chat / PRINT statement issues

Author
Message
Thrasher16
10
Years of Service
User Offline
Joined: 30th Aug 2013
Location: United Kingdom
Posted: 30th Aug 2013 09:57
I've been working my way through the 'Hands On' book but have come across an issue with the PRINT statement.

Basically the PRINT statement does not seem to work when it is outside of the do loop.

i.e:

do
Print("hello world")
Sync()
loop

Print("hello world")
Sync()
do
loop

The first case works fine, but not the second!

Anyone got any ideas?
JimHawkins
14
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 30th Aug 2013 11:18
Print needs to be inside the loop. Sync() puts stuff on the screen.

-- Jim - When is there going to be a release?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Aug 2013 15:54
The 'Hands On' book code works for v1076 but not for v108+.

This is a known issue and hopefully will be addressed at some point.

The Print statement is not a permanent thing like sprites. It must be followed by a Sync call (at some point) within the same loop in order for it to be displayed.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
AlistairS
11
Years of Service
User Offline
Joined: 28th Apr 2013
Location: U.K.
Posted: 30th Aug 2013 17:43
The way Sync() is implemented has changed since the book was written. To get the code in the book to work properly, just add the line
Sync()
at the start of your program.
Thrasher16
10
Years of Service
User Offline
Joined: 30th Aug 2013
Location: United Kingdom
Posted: 31st Aug 2013 10:35
Thanks AlistairS.

That works perfectly now.

Login to post a reply

Server time is: 2024-05-09 07:47:24
Your offset time is: 2024-05-09 07:47:24