unit Monatstage;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Dialogs, raFunc, ppRTTI, DateUtils;
type
TmyDaysInAMonthFunction =
class (TraStringFunction)
public
procedure ExecuteFunction(aParams: TraParamList);
override;
class function GetSignature:
String;
override;
end;
implementation
uses U_DataModule, U_Main;
{------------------------------------------------------------------------------}
{ TmyDaysInAMonthFunction.GetSignature }
class function TmyDaysInAMonthFunction.GetSignature:
String;
begin
Result := '
function DaysInAMonth(iJahr: Integer; iMonat: Integer): Integer;';
end;
{------------------------------------------------------------------------------}
{ TmyDaysInAMonthFunction.ExecuteFunction }
procedure TmyDaysInAMonthFunction.ExecuteFunction(aParams: TraParamList);
var
iJahr, iMonat, iRueckgabe: Integer;
begin
GetParamValue(0, iJahr);
GetParamValue(1, iMonat);
//iRueckgabe := DaysInMonth(EncodeDate(iJahr, iMonat, 1));
iRueckgabe := DaysInAMonth(iJahr, iMonat);
SetParamValue(2, iRueckgabe);
end;
initialization
raRegisterFunction('
DaysInAMonth', TmyDaysInAMonthFunction);
finalization
raUnRegisterFunction('
DaysInAMonth');
end.