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 / Errors and Warnings, how to ?

Author
Message
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 29th Apr 2019 22:55
Hello,

The AppGameKit doc says here : https://www.appgamekit.com/documentation/examples/general/3_errors.htm

Display an error
In the event that something doesn't quite behave as expected you can call the command Error to display an error message on screen:



Display a warning
Warnings can be used when something may be amiss, but it's not quite critical to the running of the application. To display a warning use the command Warning. A warning will get displayed in the debug output of the IDE:



But when I try to use them in my source code, these commands generates errors during compilation. why ?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 29th Apr 2019 23:03 Edited at: 29th Apr 2019 23:07
To be honest i had no idea those commands existed.
However if you want to display a message at runtime you could use Message() to display a dialog message or print() to display a message and continue

ps: I just tested it and i see what you mean about the compile error : "error" is not a recognised function or command
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Apr 2019 00:21 Edited at: 30th Apr 2019 00:43
i've never really used the debugger but the ability to manually generate an error/warning "pop up" might be a tier2 only thing?

otherwise, i think the help files might be wrong/misleading with re: to what i distinguish as error vs warning.

to me, if it's an error, the program will stop altogether and provide the error message (which it does, no matter what).

if it's a warning, the program may carry on depending on SetDebugMode()

with that, what more functionality do you want beyond the above and below?



...in conjunction with the various SetErrorMode()s (which i just found out that you cannot change during runtime)?

Ie, Mode1:



meanwhile, looking at debugger stuff, i see there are 2 (completely) different Log() commands. i guess if they were used properly (string vs float?), the error-version could be helpful?


btw, if you want the warnings to pop up, see the MessageBox function in MadBit's FileExplore ?

Oops, forgot about Message(). i only skimmed through blink's response.

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Apr 2019 00:36
That's one of the great things about AppGameKit studio it allows you to watch variables and step through code
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Freddix
AGK Developer
21
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 1st May 2019 08:22 Edited at: 1st May 2019 08:24
@All : Thank you for your answers. Message is the method I currently use to display errors/warning.
But What I liked in these commands (that don't work in AppGameKit, not recognized), is that Error can break the program at the line where error was reported.

@Virtual Nomad : I Understand.. So it should not work on classic AppGameKit for Windows/Android/iOS/OsX ...

@Fubarpk : Even in my AppGameKit Studio version (beta), these commands are not recognized. Probably due to tier2 only restrictions like said Virtual Nomad.

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st May 2019 10:28 Edited at: 1st May 2019 10:29
Just tried the Log("string") command. Does anyone know where that is logged?
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 1st May 2019 11:04
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st May 2019 21:51
So it only logs a message when in debug

Login to post a reply

Server time is: 2024-03-28 22:20:10
Your offset time is: 2024-03-28 22:20:10