Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Variables
Constants
Functions and Procedures
Identifiers

Class TSLFunction

Unit

SLFunAgr

Declaration

type TSLFunction = class(TSLCustomFun)

Description

Function class component

Duering query execution SQLite calls callback to determine result of function or aggregation. From the manager callback can get pointer to function's object and call DoFunction protected method. Here number of params is checked - in case of problems an error is reported. The Method converts array of PChar to TStringList so the engine is separated from your code but one convertion more is done. At the end event OnFunction is called.

Parameters are passed as TStrings. Do not change list object - it is common for all calls. You can change values, but I have no idea why.

Hierarchy

TSLCustomFun

Fields

 NameDescription
Protected FParamCount  
Protected FParams  

Methods

Overview

Public constructor Create (AOwner: TComponent); override;
Public destructor Destroy; override;
Protected procedure DoFunction (const aParamCount: Integer; const aParams: PPCharArray); virtual;
Public function GetCallBackPtr: Pointer; virtual;
Public function GetResTypeAsInt: Integer;
Protected procedure SetActive (const aValue: Boolean); override;
Protected procedure SetParamCount (const aValue: Integer);

Description

Public constructor Create (AOwner: TComponent); override;

 

Public destructor Destroy; override;

 

Protected procedure DoFunction (const aParamCount: Integer; const aParams: PPCharArray); virtual;

 

Public function GetCallBackPtr: Pointer; virtual;

 

Public function GetResTypeAsInt: Integer;

 

Protected procedure SetActive (const aValue: Boolean); override;

Main process of encounting function result

First number of params is checked - in case of problems an error is reported. The Method converts array of PChar to TStringList so the engine is separated from your code but one convertion more is done. At the end event OnFunction is called.

Protected procedure SetParamCount (const aValue: Integer);

Writter of property ParamCount. It allocates space for param list.

Properties

Overview

Published property OnFunction: TOnFunction;
Published property ParamCount: Integer;

Description

Published property OnFunction: TOnFunction;

abstract(Event for function encounting) You can be sure that number of params is propper. Results should be returned with one of methods TSLDatabase.SetResultString, TSLDatabase.SetResultInt, TSLDatabase.SetResultDouble - depends on the result's type. In case of problems TSLDatabase.SetResultError method should be called

Published property ParamCount: Integer;

abstract(Number of parameters used by function)


Generated by PasDoc 0.8.7 on N 16- lis 2003 16:05:18