Getting error string from SCErr?

External developers... This forum's for you!

Getting error string from SCErr?

Postby Dave_Higgins » Wed Sep 15, 2010 1:28 pm

I tried searching through Google for this one, but I got a bazillion hits that related to java, .asp, etc...

Given the equates for error codes:
Code: Select all
enum errNum {
   isOK = 0,               //   no error
   noSuchObject = -10000,      //   specified object not found
   noSuchCard = -9999,         //   specified card not found
   noSuchBkgnd = -9998,      //   specified background not found
   .....
   unknownErr = -9946         //    Encountered an unspecified error
};

Is there an easy way (in C-speak) to obtain the short string (whatever the proper term is) when you know the code? Before I write up my own weird function, I'd like to be able to do something like (with SCErr being -9999) GetErrorString(SCErr) and get back the string "noSuchCard"... Much like errorText() in SC.

Or maybe I missed an IT function to do this?
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: Getting error string from SCErr?

Postby codegreen » Thu Sep 16, 2010 8:48 am

Dave Higgins wrote:Is there an easy way (in C-speak) to obtain the short string (whatever the proper term is) when you know the code? Before I write up my own weird function, I'd like to be able to do something like (with SCErr being -9999) GetErrorString(SCErr) and get back the string "noSuchCard"... Much like errorText() in SC

No, AFAIK there isn't.

-Mark
codegreen
 
Posts: 1510
Joined: Mon Jul 14, 2008 11:03 pm

Re: Getting error string from SCErr?

Postby Dave_Higgins » Thu Sep 16, 2010 9:06 am

mark wrote:No, AFAIK there isn't.

Alright. It didn't take much to write a couple methods aside for that. SC sure comes in handy for little one-shot helpers like that. :)
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon


Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest