[fpc-pascal]mysql

kleber krebshermsdorff at netscape.net
Tue Aug 19 03:49:55 CEST 2003


hi,

I've a problem with the mysql_data_seek procedure with fpc 1.0.10.
If I call this function in the main program block it runs correctly but 
if I call this one into a function or procedure this moves the row 
pointer to nil, except if all the procedures or functions that call 
mysql_data_seek uses the cdecl convension.
I've created this procedure replacing the original from mysqldb.pas:
-------------------------------------------------------------------------------------------------------------------------------------
procedure mysql_data_seek(local_res: PMYSQL_RES; local_row:my_ulonglong);
var
  base,
  cursor : PMYSQL_ROWS;
begin
  with local_res^ do begin
    base := data^.data;
    cursor := base;
    while local_row > 0 do begin
      if cursor <> nil then
        cursor := cursor^.next;
      dec(local_row);
    end;
    data_cursor := cursor;
  end;
end;
----------------------------------------------------------------------------------------------------------
This is very simple but runs correctly.

Kleber Hermsdorff
-- 
Your favorite stores, helpful shopping tools and great gift ideas. 
Experience the convenience of buying online with Shop at Netscape! 
http://shopnow.netscape.com/





More information about the fpc-pascal mailing list