Code: Select all
; 0.0.08.00/2019-03-09/just me - Added basic support for application-defined functions
...
; ===================================================================================================================
; METHOD CreateScalarFunc Create a scalar application defined function
; Parameters: Name - the name of the function
; Args - the number of arguments that the SQL function takes
; Func - a pointer to AHK functions that implement the SQL function
; Enc - specifies what text encoding this SQL function prefers for its parameters
; Param - an arbitrary pointer accessible within the funtion with sqlite3_user_data()
; Return values: On success - True
; On failure - False, ErrorMsg / ErrorCode contain additional information
; Documentation: www.sqlite.org/c3ref/create_function.html
; ===================================================================================================================
...
; ======================================================================================================================
; Exemplary custom callback function regexp()
; Parameters: Context - handle to a sqlite3_context object
; ArgC - number of elements passed in Values (must be 2 for this function)
; Values - pointer to an array of pointers which can be passed to sqlite3_value_text():
; 1. Needle
; 2. Haystack
; Return values: Call sqlite3_result_int() passing 1 (True) for a match, otherwise pass 0 (False).
; ======================================================================================================================