|
From: Markus H. <mar...@mh...> - 2003-08-26 19:47:12
|
Christian M. Stamgren writes:
> No It's not a bug. It's a feature ;)
>
Can we settle on "misfeature" if it's not a bug then? I don't have a
clean solution, but we can try to use the lesser evil. E.g. consider
the following (untested) code:
int dbi_result_next_row(dbi_result Result) {
dbi_result_t *result = Result;
if (!result) return 0;
if (result->currowidx == dbi_result_get_numrows(Result)) {
return 0;
}
else if (result->currowidx > dbi_result_get_numrows(Result)) {
_error_handler(result->conn, DBI_ERROR_BADIDX);
return 0;
}
return dbi_result_seek_row(Result, result->currowidx+1);
}
This would allow to run a while loop without triggering the error
handler. The price we'd have to pay is that the first call in a for
loop that accidentally goes beyond the bounds will return 0
(correctly) but not trigger the error handler.
regards,
Markus
--
Markus Hoenicka
mar...@ca...
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de
|