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 Studio Chat / [SOLVED] Serial Port Plugin - Errorcode checking/process

Author
Message
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 9th Jan 2020 02:23
Is there any way to trap the errorcode with the serial plugin

Example.
The APP is running fine, when I have the Serial USB Plugged in, but when unplug the Serial port, it give me an error message... and the APP stop

I want to do error checking and do something else when an error occured instead of the error messagebox, and app exit

Thanks

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

Go to answer

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Jan 2020 02:24 Edited at: 9th Jan 2020 02:25
You can use SetErrorMode(0) just prior to the command.
Then use GetLastError() and GetErrorOccurred() to check if an error occured

Remember to setErrorMode() back to it's origional state if you're not constantly checking for errors
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 9th Jan 2020 02:56
This post has been marked by the post author as the answer.
Thanks BlinkOk. Will test
Appreciate the help

Login to post a reply

Server time is: 2024-03-29 07:20:54
Your offset time is: 2024-03-29 07:20:54