Hi,

Steve Kieu yazmış:
> 
> Hi all, I am trying to bind wxSqlite3 to lua and do not know how to use 
> exception in wxlua. wxSqlite3 has an exception class and in c++ the try 
> catch exception. How can I use it in wxlua? Something translated like
> 
> local db=wxSqlite3DB()
> db:Open(path)
> x,y=db:ExecuteQuery(sql)
> 
> -- if x =nil then y contains error msg.
> 
> Can I I do it in wxlua binding r I have to manually code it in c++ using 
> lua c api?
> 
> cheers
> 
> 
> 
> S.KIEU
> 

In my lua binding of wxSQLite3 (done with Lunar),
I returned exception object as an additional result of functions.

//---------------------------------------------------------------------------
// push_exception
//
// NOTE: nil is pushed for SQLITE_OK
//
// Exception object is returned as last(additional) function result
// Usage ex:
// local rid,e = db:GetLastRowId()
// if e then -- an exception throwed (rid set to nil also)
//    -- use exception object
//    ec = e:GetErrorCode()
//    es = e:GetMessage()
// end
//---------------------------------------------------------------------------

You may get my work from: http://www.dynaset.org/dogusanh


--
Regards,
Hakki Dogusan




_______________________________________________
Wxlua-users mailing list
Wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to