9.2. What should i do if it's dosn't work?

Like all other software in the world there are never been problems and all works fine. So why should there be an anwser of this question? Because that's an lie. No software works always perfect. And that is the reason why this question is so important.

At first the functions of the library normaly shouldn't raise any error. Except you pass an invalid string buffer to one function or there are internal errors. The normal way how the functions handle errors is to set an error number and an error function. You can query the last error number with tsGetError. But beware. After the call the error number are set zu TS_NO_ERROR (0). You should cache the error number in an local variable.

var
  Error: tsEnum;

Error := tsGetError();

if Error <> TS_NO_ERROR then
  // there was an error

Whats now with error number? You also can query an really short text to the error. But this only the error const as text as an real error description. The main problem is what function set the error. Typical no developer check errors after every function call. So i have implemented the code from the error function. This code indify the function they have set the error code. So it's easier to find the last function they set an error. But dosn't need to be the source of all evil. It's only the end. The function code wont be reset by tsGetError.

var
  ErrorFunction: tsEnum;

ErrorFunction := tsGetErrorFunction();

With the ErrorFunction you are able to search for the group of functions they have set the error. All you need is the "Errorfunction codes table". As third column in this table you will find an link to the function page in the help. Below on ever side you find an list of possible error codes and the right meaning of them.

With this infos you should be able to get some steps back and check the error at some early times or directly fix it.

[Tip] Tip

You always can check for errors. That not depending on debug versions. Because the tsGetError call is really cheap and if there was no error there is nothing more to do. But if there was an error you will see it quickly. And so you will save time of wondering why the library is getting his own live. Personally is prefer to check for errors after rendering the complete frame or done all text draws.