[yunqa.de] Re: disqlite - adding functions

  • From: Delphi Inspiration <delphi@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Tue, 24 Jun 2008 14:12:03 +0200

Clyde wrote:

>I just copied the sample code from the Create_function demo. That is why I 
>thought the problem might have something to do with the application type 
>because most of the examples are console applications.

There was an exchange of opinions about console demos on this list some time 
ago. I like console demos because thy keep things as simple and in-one-file as 
possible.

For DISQLite3, the application type does not matter: It works equally well in 
both console and GUI applications!

>I just wanted to get one function working in my test application before I 
>started writing more of my own, but at this stage I can't get the pos example 
>to work because of the compile error previously mentioned.
>
>The code for the pos function I have used is (copy and pasted from the example)

The function in my Demo code (looks differently! You must be using an older 
version of the demo (before DISQLite 1.5.0) with DISQLite3 1.5.0 or later! 

>procedure Pos_Function_Callback(Context: Pointer; nArgs: Integer; Args: 
>PPointerArray);

The function declaration is incorrect. Instead, please use this one which I 
already posted in my previous message:

procedure Some_Function_Callback(
  pCtx: sqlite3_context; // <-- You are using "Pointer" here
  //    ^^^^^^^^^^^^^^^         which is causing you problems!
  nArgs: Integer; 
  Args: PPointerArray);

Ralf  

_______________________________________________
Delphi Inspiration mailing list
yunqa@xxxxxxxxxxxxx
//www.freelists.org/list/yunqa



Other related posts: