Subject | Re: [firebird-support] UDF assistance |
---|---|
Author | Ivan Prenosil |
Post date | 2008-12-01T17:41:05Z |
> Declaration:Memory for the result must be allocated using:
> ============
>
> DECLARE EXTERNAL FUNCTION FB_ADDMINS
> TIMESTAMP,INTEGER
> RETURNS TIMESTAMP FREE_IT
> ENTRY_POINT 'FB_AddMins' MODULE_NAME 'MyUDF';
>
> UDF Code (Delphi 7):
> ==================
> {Export Functions}
>
> function FB_AddMins(var DT: ISC_TIMESTAMP; var Minutes: Integer):
> PISC_TIMESTAMP; cdecl;
> var
> DTConverted: TDateTime;
> begin
> OutputDebugString('FB_AddMins Start');
> DTConverted := TimeStampToDateTime(DT);
> DTConverted := DTConverted + Minutes/1440;
> DT := DateTimeToTimeStamp(DTConverted);
> Result := @DT;
> OutputDebugString('FB_AddMins End');
> end;
function ib_util_malloc(size: LongWord): Pointer; external 'ib_util.dll';
Ivan