Re: [Vala] SQLite callback problem



On 4 July 2010 23:06, Leoncio Gil <lgg2lgg2 gmail com> wrote:
Hello,

I am having problems with the SQLite.exec callback.

There is any form to access from inside of the callback (public static int
....) to any public GLib.List?

Whe I try to compile it always I get a "Access to instance member
'classxxxxx.varxxxx' denied"

In example (shorted):

public class MyDB:GLib:object {

      Database db;
      int Counter;
      int rc;

      public MyDB() {

                rc = Database.open ("mydb.slite", out db);
                rc = db.exec ("select * from test", SQLCallback, null);

       }

       public static int SQLCallback (int nColumns, string[] Data, string[]
nmColumns) {

                 Counter = 0;
                 return 0;

        }
}

I get the error in the "Counter = 0;" line.

Counter is an instance variable, but your SQLCallback is a static
method, meaning it is executed without reference to an instance of
your class.

Someone? Thanks.

_______________________________________________
vala-list mailing list
vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list



-- 
Phil Housley



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]