Wiki Page Content

Differences between revisions 12 and 13
Revision 12 as of 2010-08-29 19:20:19
Size: 900
Editor: Sam Lantinga
Comment: null
Revision 13 as of 2013-07-22 08:23:54
Size: 876
Editor: axper
Comment: removed unnecessary newline in syntax
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Line 11: Line 10:
void SDL_SetError(const char* fmt,
                  
...)
void SDL_SetError(const char* fmt, ...)
Line 14: Line 12:
== Function Parameters ==
||'''fmt''' ||a printf() style message format string ||
||'''...''' ||additional parameters matching % tokens in the '''fmt''' string, if any ||
Line 15: Line 16:
== Function Parameters ==
||'''fmt'''||a printf() style message format string||
||'''...'''||additional parameters matching % tokens in the '''fmt''' string, if any||
Line 23: Line 21:
Line 32: Line 29:
Line 37: Line 33:
 .[[SDL_ClearError]]
 .[[SDL_GetError]]
 . [[SDL_ClearError]]
 . [[SDL_GetError]]
Line 41: Line 37:
[[CategoryAPI]], [[CategoryError]] [[CategoryAPI]], CategoryError

SDL_SetError

Use this function to set the SDL error string.

Syntax

void SDL_SetError(const char* fmt, ...)

Function Parameters

fmt

a printf() style message format string

...

additional parameters matching % tokens in the fmt string, if any

Code Examples

SDL_SetError("Something unexpected happened!");

int errorCode = 0;
...
errorCode = -37;
...
if (errorCode < 0)
    SDL_SetError("Something unexpected happened: Error Code %d", errorCode);

Remarks

Calling this function will replace any previous error message that was set.


CategoryAPI, CategoryError

None: SDL_SetError (last edited 2016-05-11 20:22:50 by PhilippWiesemann)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit