Description | Hierarchy | Fields | Methods | Properties |
type TFunctionClass = class(TObject)
TFunctionClass
defines a function that can be called by TRbwParser.
![]() |
FSynonyms: TStrings; |
![]() |
FunctionRecord: TFunctionRecord; |
![]() |
FPrototype: string; |
![]() |
function GetAllowConversionToConstant: boolean; |
![]() |
function GetBFunctionAddr: TrbwBooleanFunction; |
![]() |
function GetHidden: boolean; |
![]() |
function GetIFunctionAddr: TrbwIntegerFunction; |
![]() |
function GetInputDataCount: integer; |
![]() |
function GetInputDataTypes(const Index: integer): TRbwDataType; |
![]() |
function GetName: string; |
![]() |
function GetOptionalArguments: integer; inline; |
![]() |
function GetResultType: TRbwDataType; |
![]() |
function GetRFunctionAddr: TrbwRealFunction; |
![]() |
function GetSFunctionAddr: TrbwStringFunction; |
![]() |
procedure SetAllowConversionToConstant(const Value: boolean); inline; |
![]() |
procedure SetBFunctionAddr(const Value: TrbwBooleanFunction); |
![]() |
procedure SetHidden(const Value: boolean); inline; |
![]() |
procedure SetIFunctionAddr(const Value: TrbwIntegerFunction); |
![]() |
procedure SetInputDataCount(const Value: integer); |
![]() |
procedure SetInputDataTypes(const Index: integer; const Value: TRbwDataType); |
![]() |
procedure SetName(const Value: string); |
![]() |
procedure SetOptionalArguments(const Value: integer); inline; |
![]() |
procedure SetRFunctionAddr(const Value: TrbwRealFunction); |
![]() |
procedure SetSFunctionAddr(const Value: TrbwStringFunction); |
![]() |
procedure SetSynonyms(const Value: TStrings); |
![]() |
function GetOptionalType: TRbwDataType; |
![]() |
procedure SetOptionalType(const Value: TRbwDataType); |
![]() |
constructor Create; |
![]() |
destructor Destroy; override; |
![]() |
FSynonyms: TStrings; |
|
![]() |
FunctionRecord: TFunctionRecord; |
|
![]() |
FPrototype: string; |
|
![]() |
function GetAllowConversionToConstant: boolean; |
![]() |
function GetBFunctionAddr: TrbwBooleanFunction; |
Gets value of BFunctionAddr property |
![]() |
function GetHidden: boolean; |
See Hidden. |
![]() |
function GetIFunctionAddr: TrbwIntegerFunction; |
Gets value of IFunctionAddr property |
![]() |
function GetInputDataCount: integer; |
See InputDataCount. |
![]() |
function GetInputDataTypes(const Index: integer): TRbwDataType; |
See InputDataTypes. |
![]() |
function GetName: string; |
See Name. |
![]() |
function GetOptionalArguments: integer; inline; |
See OptionalArguments. |
![]() |
function GetResultType: TRbwDataType; |
See ResultType. |
![]() |
function GetRFunctionAddr: TrbwRealFunction; |
Gets value of RFunctionAddr property |
![]() |
function GetSFunctionAddr: TrbwStringFunction; |
Gets value of SFunctionAddr property |
![]() |
procedure SetAllowConversionToConstant(const Value: boolean); inline; |
![]() |
procedure SetBFunctionAddr(const Value: TrbwBooleanFunction); |
Sets value of BFunctionAddr property |
![]() |
procedure SetHidden(const Value: boolean); inline; |
See Hidden. |
![]() |
procedure SetIFunctionAddr(const Value: TrbwIntegerFunction); |
Sets value of IFunctionAddr property |
![]() |
procedure SetInputDataCount(const Value: integer); |
See InputDataCount. |
![]() |
procedure SetInputDataTypes(const Index: integer; const Value: TRbwDataType); |
See InputDataTypes. |
![]() |
procedure SetName(const Value: string); |
See Name. |
![]() |
procedure SetOptionalArguments(const Value: integer); inline; |
See OptionalArguments. |
![]() |
procedure SetRFunctionAddr(const Value: TrbwRealFunction); |
Sets value of RFunctionAddr property |
![]() |
procedure SetSFunctionAddr(const Value: TrbwStringFunction); |
Sets value of SFunctionAddr property |
![]() |
procedure SetSynonyms(const Value: TStrings); |
See Synonyms. |
![]() |
function GetOptionalType: TRbwDataType; |
![]() |
procedure SetOptionalType(const Value: TRbwDataType); |
![]() |
constructor Create; |
Users should generally not call |
![]() |
destructor Destroy; override; |
|
![]() |
property AllowConversionToConstant: boolean
read GetAllowConversionToConstant write SetAllowConversionToConstant; |
Normally Pi is an example of a function for which
|
![]() |
property BFunctionAddr: TRbwBooleanFunction read GetBFunctionAddr
write SetBFunctionAddr; |
|
![]() |
property IFunctionAddr: TRbwIntegerFunction read GetIFunctionAddr
write SetIFunctionAddr; |
|
![]() |
property InputDataCount: integer read GetInputDataCount
write SetInputDataCount; |
|
![]() |
property InputDataTypes[constIndex:integer]: TRbwDataType
read GetInputDataTypes write SetInputDataTypes; |
|
![]() |
property OptionalType: TRbwDataType
read GetOptionalType write SetOptionalType; |
![]() |
property Name: string read GetName write SetName; |
|
![]() |
property Prototype: string read FPrototype write FPrototype; |
|
![]() |
property OptionalArguments: integer read GetOptionalArguments
write SetOptionalArguments; |
If If |
![]() |
property ResultType: TRbwDataType read GetResultType; |
Example: Because OptionalArguments is less than 0, the CaseB, CaseI, CaseR, and CaseS functions can take an unlimited number of arguments. function _CaseBoolean(Values : array of pointer) : boolean; begin result := PBoolean(Values[PInteger(Values[0])ˆ])ˆ; end; function _CaseInteger(Values : array of pointer) : integer; begin result := PInteger(Values[PInteger(Values[0])ˆ])ˆ; end; function _CaseDouble(Values : array of pointer) : double; begin result := PDouble(Values[PInteger(Values[0])ˆ])ˆ; end; function _CaseString(Values : array of pointer) : String; begin result := PString(Values[PInteger(Values[0])ˆ])ˆ; end; var CaseBooleanFunction : TFunctionRecord; CaseIntegerFunction : TFunctionRecord; CaseDoubleFunction : TFunctionRecord; CaseStringFunction : TFunctionRecord; constructor TFunctionStringList.Create; begin inherited; CaseSensitive := False; Duplicates := dupError; Sorted := True; // ... others lines omitted in example. CaseBooleanFunction.ResultType := rdtBoolean; CaseBooleanFunction.Name := 'CaseB'; SetLength(CaseBooleanFunction.InputDataTypes, 4); CaseBooleanFunction.InputDataTypes[0] := rdtInteger; CaseBooleanFunction.InputDataTypes[1] := rdtBoolean; CaseBooleanFunction.InputDataTypes[2] := rdtBoolean; CaseBooleanFunction.InputDataTypes[3] := rdtBoolean; CaseBooleanFunction.CanConvertToConstant := True; CaseBooleanFunction.OptionalArguments := -1; CaseBooleanFunction.BFunctionAddr := _CaseBoolean; Add(CaseBooleanFunction); CaseIntegerFunction.ResultType := rdtInteger; CaseIntegerFunction.Name := 'CaseI'; SetLength(CaseIntegerFunction.InputDataTypes, 4); CaseIntegerFunction.InputDataTypes[0] := rdtInteger; CaseIntegerFunction.InputDataTypes[1] := rdtInteger; CaseIntegerFunction.InputDataTypes[2] := rdtInteger; CaseIntegerFunction.InputDataTypes[3] := rdtInteger; CaseIntegerFunction.OptionalArguments := -1; CaseIntegerFunction.CanConvertToConstant := True; CaseIntegerFunction.IFunctionAddr := _CaseInteger; Add(CaseIntegerFunction); CaseDoubleFunction.ResultType := rdtDouble; CaseDoubleFunction.Name := 'CaseR'; SetLength(CaseDoubleFunction.InputDataTypes, 4); CaseDoubleFunction.InputDataTypes[0] := rdtInteger; CaseDoubleFunction.InputDataTypes[1] := rdtDouble; CaseDoubleFunction.InputDataTypes[2] := rdtDouble; CaseDoubleFunction.InputDataTypes[3] := rdtDouble; CaseDoubleFunction.OptionalArguments := -1; CaseDoubleFunction.CanConvertToConstant := True; CaseDoubleFunction.RFunctionAddr := _CaseDouble; Add(CaseDoubleFunction); CaseStringFunction.ResultType := rdtString; CaseStringFunction.Name := 'CaseS'; SetLength(CaseStringFunction.InputDataTypes, 4); CaseStringFunction.InputDataTypes[0] := rdtInteger; CaseStringFunction.InputDataTypes[1] := rdtString; CaseStringFunction.InputDataTypes[2] := rdtString; CaseStringFunction.InputDataTypes[3] := rdtString; CaseStringFunction.OptionalArguments := -1; CaseStringFunction.CanConvertToConstant := True; CaseStringFunction.SFunctionAddr := _CaseString; Add(CaseStringFunction); // ... others lines omitted in example. end; |
![]() |
property RFunctionAddr: TRbwRealFunction read GetRFunctionAddr
write SetRFunctionAddr; |
|
![]() |
property SFunctionAddr: TRbwStringFunction read GetSFunctionAddr
write SetSFunctionAddr; |
|
![]() |
property Hidden: boolean read GetHidden write SetHidden; |
|
![]() |
property Synonyms: TStrings read FSynonyms
write SetSynonyms; |
See also
|