I have the problem that the MySQL connection gets lost after about 10 minutes due to the MySQL server setup. It would be quite easy to reconnect having the error code. The currently only build in way is parsing the error string that is returned by DatabaseError().
My workaround is importing the mysql_errno function from the library. So I think it is quite easy to add this as a native Purebasic function.
Fred, DatabaseError returns a string. Can she get the number back? There is no functions in PB that depending on the flag returns a number or a string. This is forbidden at the compiler level.
What about adding a new command "GetLastError()", which is independant of any library?
You could get rid of DatabaseError(), DialogError(), SerialPortError(), XMLError(), ... and there would be only one command to retrieve the last errors.
That would be the first step for a PB, full of usable error messages (think about the network library as one example, almost unusable without using API to retrieve error messages).
Maybe add another command like "GetLastErrorText()", for those, who never do any multi-language apps.