Ести таки function в FastReport3 ?

отредактировано 06:45 Раздел: FastScript
в FastReport 3 ести такоие
1- IncMonth()
2- IncDay()
3- IncWeek()
4- IncYear()


Комментарии

  • gpigpi
    отредактировано 06:45
    Нет. Придётся писать свои и подключать как пользовательские.
  • отредактировано 06:45
    Sergiu написал:
    в FastReport 3 ести такоие
    1- IncMonth()
    2- IncDay()
    3- IncWeek()
    4- IncYear()
    unit fs_DateUtils_rtti;
    
    interface
    
    {$i fs.inc}
    
    uses fs_iinterpreter, fs_ievents, Classes,
      DateUtils, SysUtils, Math, Types;
    
    
    type
      TfsDateUtilsRTTI = class(TComponent); 
    
    
    implementation
    
    uses Variants;
    
    type
      TFunctions = class(TfsRTTIModule)
      private
        function CallMethod(Instance: TObject; ClassType: TClass;
          const MethodName: String; Caller: TfsMethodHelper): Variant;
      public
        constructor Create(AScript: TfsScript); override;
        destructor Destroy; override;
      end;
    
    var
      Functions: TFunctions;
    
    
    { TFunctions }
    
    constructor TFunctions.Create;
    begin
      inherited Create(AScript);
      with AScript do begin
        AddMethod('function DateOf(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function TimeOf(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IsInLeapYear(const AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsPM(const AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsValidDate(const AYear, AMonth, ADay: integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsValidTime(const AHour, AMinute, ASecond, AMilliSecond: integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsValidDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsValidDateDay(const AYear, ADayOfYear: integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsValidDateWeek(const AYear, AWeekOfYear, ADayOfWeek: integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsValidDateMonthWeek(const const AYear, AMonth, AWeekOfMonth,ADayOfWeek: integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WeeksInYear(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function WeeksInAYear(const AYear: integer): integer', CallMethod,'Обработка дат','');
        AddMethod('function DaysInYear(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function DaysInAYear(const AYear: integer): integer', CallMethod,'Обработка дат','');
        AddMethod('function DaysInMonth(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function DaysInAMonth(const AMonth: integer): integer', CallMethod,'Обработка дат','');
        AddMethod('function Today: TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function Yesterday: TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function Tomorrow: TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IsToday(const AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function IsSameDay(const AValue, ABasis: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function YearOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MonthOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function WeekOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function DayOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function HourOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MinuteOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SecondOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOf(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function StartOfTheYear(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfTheYear(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfAYear(const AYear: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfAYear(const AYear: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfTheMonth(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfTheMonth(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfAMonth(const AYear, AMonth: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfAMonth(const AYear, AMonth: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfTheWeek(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfTheWeek(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfAWeek(const AYear, ADayOfWeek: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfAWeek(const AYear, ADayOfWeek: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfTheDay(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfTheDay(const AValue: TDateTime): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfADay(const AYear, AMonth, ADay: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfADay(const AYear, AMonth, ADay: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function StartOfADay1(const AYear, ADayOfYear: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EndOfADay1(const AYear, ADayOfYear: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function MonthOfTheYear(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function WeekOfTheYear(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function WeekOfTheYear1(const AValue: TDateTime; var AYear: integer): integer', CallMethod,'Обработка дат','');
        AddMethod('function DayOfTheYear(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function HourOfTheYear(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MinuteOfTheYear(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function SecondOfTheYear(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheYear(const AValue: TDateTime): Int64', CallMethod,'Обработка дат','');
        AddMethod('function WeekOfTheMonth(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function WeekOfTheMonth1(const AValue: TDateTime; var AYear, AMonth: integer): integer', CallMethod,'Обработка дат','');
        AddMethod('function DayOfTheMonth(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function HourOfTheMonth(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MinuteOfTheMonth(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SecondOfTheMonth(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheMonth(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function DayOfTheWeek(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function HourOfTheWeek(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MinuteOfTheWeek(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SecondOfTheWeek(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheWeek(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function HourOfTheDay(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MinuteOfTheDay(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SecondOfTheDay(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheDay(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function MinuteOfTheHour(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SecondOfTheHour(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheHour(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function SecondOfTheMinute(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheMinute(const AValue: TDateTime): LongWord', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondOfTheSecond(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastYears(const ANow, AThen: TDateTime; const AYears: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastMonths(const ANow, AThen: TDateTime; const AMonths: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastWeeks(const ANow, AThen: TDateTime; const AWeeks: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastDays(const ANow, AThen: TDateTime; const ADays: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastHours(const ANow, AThen: TDateTime; const AHours: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastMinutes(const ANow, AThen: TDateTime; const AMinutes: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastSeconds(const ANow, AThen: TDateTime; const ASeconds: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function WithinPastMilliSeconds(const ANow, AThen: TDateTime; const AMilliSeconds: Integer): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function YearsBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function MonthsBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function WeeksBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function DaysBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function HoursBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function MinutesBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function SecondsBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondsBetween(const ANow,AThen: TDateTime): Integer', CallMethod,'Обработка дат','');
        AddMethod('function YearSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function MonthSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function WeekSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function DaySpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function HourSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function MinuteSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function SecondSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function MilliSecondSpan(const ANow,AThen: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function IncYear(const AValue: TDateTime; const ANumberOfYears: Integer = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IncWeek(const AValue: TDateTime; const ANumberOfWeeks: Integer = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IncDay(const AValue: TDateTime; const ANumberOfDays: Integer = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IncHour(const AValue: TDateTime; const ANumberOfHours: Int64 = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IncMinute(const AValue: TDateTime; const ANumberOfMinutes: Integer = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IncSecond(const AValue: TDateTime; const ANumberOfMinutes: Int64 = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function IncMilliSecond(const AValue: TDateTime; const ANumberOfMilliSeconds: Int64 = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('procedure DecodeDateTime(const AValue: TDateTime; var AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: integer)', CallMethod,'Обработка дат','');
        AddMethod('function EncodeDateWeek(const AYear, AWeekOfYear: integer; const ADayOfWeek: integer = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('procedure DecodeDateWeek(const AValue: TDateTime; var AYear, AWeekOfYear, ADayOfWeek: integer)', CallMethod,'Обработка дат','');
        AddMethod('function EncodeDateDay(const AYear, ADayOfYear: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('procedure DecodeDateDay(const AValue: TDateTime; var AYear, ADayOfYear: integer)', CallMethod,'Обработка дат','');
        AddMethod('function EncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth: integer; const ADayOfWeek: integer = 1): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('procedure DecodeDateMonthWeek(const AValue: TDateTime; var AYear, AMonth, AWeekOfMonth, ADayOfWeek: integer)', CallMethod,'Обработка дат','');
        AddMethod('function TryEncodeDateTime(const AYear, ADayOfYear: integer; var AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function TryEncodeDateWeek(const AYear, AWeekOfYear: integer; var AValue: TDateTime; const ADayOfWeek: integer = 1): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function TryEncodeDateDay(const AYear, ADayOfYear: integer; var AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function TryEncodeDateMonthWeek(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: integer; var AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function RecodeYear(const AValue: TDateTime; const AYear: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeMonth(const AValue: TDateTime; const AMonth: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeDay(const AValue: TDateTime;const ADay: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeHour(const AValue: TDateTime;const AHour: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeMinute(const AValue: TDateTime;const AMinute: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeSecond(const AValue: TDateTime;const ASecond: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeMilliSecond(const AValue: TDateTime;const AMilliSecond: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeDate(const AValue: TDateTime; const AYear, AMonth, ADay: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeTime(const AValue: TDateTime; const AHour, AMinute, ASecond, AMilliSecond: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function RecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function TryRecodeDateTime(const AValue: TDateTime; const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: integer; var AResult: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function CompareDateTime(const A,B: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SameDateTime(const A,B: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function CompareDate(const A,B: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SameDate(const A,B: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function CompareTime(const A,B: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('function SameTime(const A,B: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function NthDayOfWeek(const AValue: TDateTime): integer', CallMethod,'Обработка дат','');
        AddMethod('procedure DecodeDayOfWeekInMonth(const AValue: TDateTime; var AYear, AMonth, ANthDayOfWeek, ADayOfWeek: integer)', CallMethod,'Обработка дат','');
        AddMethod('function EncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: integer): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function TryEncodeDayOfWeekInMonth(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: integer, var AValue: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('procedure InvalidDateTimeError(const AYear, AMonth, ADay, AHour, AMinute, ASecond, AMilliSecond: integer; const ABaseDate: TDateTime = 0)', CallMethod,'Обработка дат','');
        AddMethod('procedure InvalidDateWeekError(const AYear, AWeekOfYear, ADayOfWeek: integer)', CallMethod,'Обработка дат','');
        AddMethod('procedure InvalidDateDayError(const AYear, ADayOfYear: integer)', CallMethod,'Обработка дат','');
        AddMethod('procedure InvalidDateMonthWeekError(const AYear, AMonth, AWeekOfMonth, ADayOfWeek: integer)', CallMethod,'Обработка дат','');
        AddMethod('procedure InvalidDayOfWeekInMonthError(const AYear, AMonth, ANthDayOfWeek, ADayOfWeek: integer)', CallMethod,'Обработка дат','');
    
        AddMethod('function DateTimeToJulianDate(const AValue: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function JulianDateToDateTime(const AValue: Double): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function TryJulianDateToDateTime(const AValue: Double; var ADateTime:TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function DateTimeToModifiedJulianDate(const AValue: TDateTime): Double', CallMethod,'Обработка дат','');
        AddMethod('function ModifiedJulianDateToDateTime(const AValue: Double): TDateTime', CallMethod,'Обработка дат','');
        AddMethod('function TryModifiedJulianDateToDateTime(const AValue: Double; var ADateTime: TDateTime): Boolean', CallMethod,'Обработка дат','');
        AddMethod('function DateTimeToUnix(const AValue: TDateTime): Int64', CallMethod,'Обработка дат','');
        AddMethod('function UnixToDateTime(const AValue: Int64): TDateTime', CallMethod,'Обработка дат','');
      end;
    end;
    
    destructor TFunctions.Destroy;
    begin
      if fsGlobalUnit <> nil then
        fsGlobalUnit.RemoveItems(Self);
      inherited;
    end;
    
    function TFunctions.CallMethod(Instance: TObject; ClassType: TClass;
      const MethodName: String; Caller: TfsMethodHelper): Variant;
    var
      Word1: Word;
      Word2: Word;
      Word3: Word;
      Word4: Word;
      Word5: Word;
      Word6: Word;
      Word7: Word;
      DT: TDateTime;
    begin
      Result := 0;
    
      if MethodName = 'DATEOF' then
      result := DateOf(TDateTime(Caller.Params[0]))
      else
      if MethodName = 'TIMEOF' then
      result := TimeOf(Caller.Params[0])
      else  
      if MethodName = 'ISINLEAPYEAR' then
      result := IsInLeapYear(Caller.Params[0])
      else  
      if MethodName = 'ISPM' then
      result := IsPM(Caller.Params[0])
      else  
      if MethodName = 'ISVALIDDATE' then
      result := IsValidDate(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'ISVALIDTIME' then
      result := IsValidTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else  
      if MethodName = 'ISVALIDDATETIME' then
      result := IsValidDateTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4], Caller.Params[5], Caller.Params[6])
      else  
      if MethodName = 'ISVALIDDATEDAY' then
      result := IsValidDateDay(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'ISVALIDDATEWEEK' then
      result := IsValidDateWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'ISVALIDDATEMONTHWEEK' then
      result := IsValidDateMonthWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else  
      if MethodName = 'WEEKSINYEAR' then
      result := WeeksInYear(Caller.Params[0])
      else
      if MethodName = 'WEEKSINAYEAR' then
      result := WeeksInAYear(Caller.Params[0])
      else
      if MethodName = 'DAYSINYEAR' then
      result := DaysInYear(Caller.Params[0])
      else  
      if MethodName = 'DAYSINAYEAR' then
      result := DaysInAYear(Caller.Params[0])
      else  
      if MethodName = 'DAYSINMONTH' then
      result := DaysInMonth(Caller.Params[0])
      else
      if MethodName = 'DAYSINAMONTH' then
      result := DaysInAMonth(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'TODAY' then
      result := Today
      else  
      if MethodName = 'YESTERDAY' then
      result := Yesterday
      else  
      if MethodName = 'TOMORROW' then
      result := Tomorrow
      else  
      if MethodName = 'ISTODAY' then
      result := IsToday(Caller.Params[0])
      else  
      if MethodName = 'ISSAMEDAY' then
      result := IsSameDay(Caller.Params[0], Caller.Params[1])
      else
      if MethodName = 'YEAROF' then
      result := YearOf(Caller.Params[0])
      else  
      if MethodName = 'MONTHOF' then
      result := MonthOf(Caller.Params[0])
      else  
      if MethodName = 'WEEKOF' then
      result := WeekOf(Caller.Params[0])
      else
      if MethodName = 'DAYOF' then
      result := DayOf(Caller.Params[0])
      else  
      if MethodName = 'HOUROF' then
      result := HourOf(Caller.Params[0])
      else  
      if MethodName = 'MINUTEOF' then
      result := MinuteOf(Caller.Params[0])
      else  
      if MethodName = 'SECONDOF' then
      result := SecondOf(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOF' then
      result := MilliSecondOf(Caller.Params[0])
      else  
      if MethodName = 'STARTOFTHEYEAR' then
      result := StartOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'ENDOFTHEYEAR' then
      result := EndOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'STARTOFAYEAR' then
      result := StartOfAYear(Caller.Params[0])
      else  
      if MethodName = 'ENDOFAYEAR' then
      result := EndOfAYear(Caller.Params[0])
      else  
      if MethodName = 'STARTOFTHEMONTH' then
      result := StartOfTheMonth(Caller.Params[0])
      else  
      if MethodName = 'ENDOFTHEMONTH' then
      result := EndOfTheMonth(Caller.Params[0])
      else  
      if MethodName = 'STARTOFAMONTH' then
      result := StartOfAMonth(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'ENDOFAMONTH' then
      result := EndOfAMonth(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'STARTOFTHEWEEK' then
      result := StartOfTheWeek(Caller.Params[0])
      else  
      if MethodName = 'ENDOFTHEWEEK' then
      result := EndOfTheWeek(Caller.Params[0])
      else
      if MethodName = 'STARTOFAWEEK' then
      result := StartOfAWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'ENDOFAWEEK' then
      result := EndOfAWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'STARTOFTHEDAY' then
      result := StartOfTheDay(Caller.Params[0])
      else  
      if MethodName = 'ENDOFTHEDAY' then
      result := EndOfTheDay(Caller.Params[0])
      else  
      if MethodName = 'STARTOFADAY' then
      result := StartOfADay(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else
      if MethodName = 'ENDOFADAY' then
      result := EndOfADay(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else
      if MethodName = 'STARTOFADAY1' then
      result := StartOfADay(Caller.Params[0], Caller.Params[1])
      else
      if MethodName = 'ENDOFADAY1' then
      result := EndOfADay(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'MONTHOFTHEYEAR' then
      result := MonthOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'WEEKOFTHEYEAR' then
      result := WeekOfTheYear(Caller.Params[0])
      else
      if MethodName = 'WEEKOFTHEYEAR1' then begin
        Word1 := Caller.Params[1];
        result := WeekOfTheYear(Caller.Params[0], Word1);
        Caller.Params[1] := Word1;
      end
      else  
      if MethodName = 'DAYOFTHEYEAR' then
      result := DayOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'HOUROFTHEYEAR' then
      result := HourOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'MINUTEOFTHEYEAR' then
      result := MinuteOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'SECONDOFTHEYEAR' then
      result := SecondOfTheYear(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHEYEAR' then
      result := MilliSecondOfTheYear(Caller.Params[0])
      else
      if MethodName = 'WEEKOFTHEMONTH' then
      result := WeekOfTheMonth(Caller.Params[0])
      else
      if MethodName = 'WEEKOFTHEMONTH1' then begin
        Word1 := Caller.Params[1];
        Word2 := Caller.Params[2];
        result := WeekOfTheMonth(Caller.Params[0], Word1, Word2);
        Caller.Params[1] := Word1;
        Caller.Params[2] := Word2;
      end
      else  
      if MethodName = 'DAYOFTHEMONTH' then
      result := DayOfTheMonth(Caller.Params[0])
      else  
      if MethodName = 'HOUROFTHEMONTH' then
      result := HourOfTheMonth(Caller.Params[0])
      else
      if MethodName = 'MINUTEOFTHEMONTH' then
      result := MinuteOfTheMonth(Caller.Params[0])
      else
      if MethodName = 'SECONDOFTHEMONTH' then
      result := SecondOfTheMonth(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHEMONTH' then
      result := MilliSecondOfTheMonth(Caller.Params[0])
      else  
      if MethodName = 'DAYOFTHEWEEK' then
      result := DayOfTheWeek(Caller.Params[0])
      else  
      if MethodName = 'HOUROFTHEWEEK' then
      result := HourOfTheWeek(Caller.Params[0])
      else  
      if MethodName = 'MINUTEOFTHEWEEK' then
      result := MinuteOfTheWeek(Caller.Params[0])
      else  
      if MethodName = 'SECONDOFTHEWEEK' then
      result := SecondOfTheWeek(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHEWEEK' then
      result := MilliSecondOfTheWeek(Caller.Params[0])
      else  
      if MethodName = 'HOUROFTHEDAY' then
      result := HourOfTheDay(Caller.Params[0])
      else  
      if MethodName = 'MINUTEOFTHEDAY' then
      result := MinuteOfTheDay(Caller.Params[0])
      else  
      if MethodName = 'SECONDOFTHEDAY' then
      result := SecondOfTheDay(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHEDAY' then
      result := MilliSecondOfTheDay(Caller.Params[0])
      else  
      if MethodName = 'MINUTEOFTHEHOUR' then
      result := MinuteOfTheHour(Caller.Params[0])
      else
      if MethodName = 'SECONDOFTHEHOUR' then
      result := SecondOfTheHour(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHEHOUR' then
      result := MilliSecondOfTheHour(Caller.Params[0])
      else  
      if MethodName = 'SECONDOFTHEMINUTE' then
      result := SecondOfTheMinute(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHEMINUTE' then
      result := MilliSecondOfTheMinute(Caller.Params[0])
      else  
      if MethodName = 'MILLISECONDOFTHESECOND' then
      result := MilliSecondOfTheSecond(Caller.Params[0])
      else  
      if MethodName = 'WITHINPASTYEARS' then
      result := WithinPastYears(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else
      if MethodName = 'WITHINPASTMONTHS' then
      result := WithinPastMonths(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'WITHINPASTWEEKS' then
      result := WithinPastWeeks(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'WITHINPASTDAYS' then
      result := WithinPastDays(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'WITHINPASTHOURS' then
      result := WithinPastHours(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'WITHINPASTMINUTES' then
      result := WithinPastMinutes(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'WITHINPASTSECONDS' then
      result := WithinPastSeconds(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'WITHINPASTMILLISECONDS' then
      result := WithinPastMilliSeconds(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'YEARSBETWEEN' then
      result := YearsBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'MONTHSBETWEEN' then
      result := MonthsBetween(Caller.Params[0], Caller.Params[1])
      else
      if MethodName = 'WEEKSBETWEEN' then
      result := WeeksBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'DAYSBETWEEN' then
      result := DaysBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'HOURSBETWEEN' then
      result := HoursBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'MINUTESBETWEEN' then
      result := MinutesBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'SECONDSBETWEEN' then
      result := SecondsBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'MILLISECONDSBETWEEN' then
      result := MilliSecondsBetween(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'YEARSPAN' then
      result := YearSpan(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'MONTHSPAN' then
      result := MonthSpan(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'WEEKSPAN' then
      result := WeekSpan(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'DAYSPAN' then
      result := DaySpan(Caller.Params[0], Caller.Params[1])
      else
      if MethodName = 'HOURSPAN' then
      result := HourSpan(Caller.Params[0], Caller.Params[1])
      else
      if MethodName = 'MINUTESPAN' then
      result := MinuteSpan(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'SECONDSPAN' then
      result := SecondSpan(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'MILLISECONDSPAN' then
      result := MilliSecondSpan(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCYEAR' then
      result := IncYear(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCWEEK' then
      result := IncWeek(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCDAY' then
      result := IncDay(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCHOUR' then
      result := IncHour(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCMINUTE' then
      result := IncMinute(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCSECOND' then
      result := IncSecond(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INCMILLISECOND' then
      result := IncMilliSecond(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'ENCODEDATETIME' then
      result := EncodeDateTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4], Caller.Params[5], Caller.Params[6])
      else  
      if MethodName = 'DECODEDATETIME' then
      begin
        DecodeDateTime(Caller.Params[0], Word1, Word2, Word3, Word4, Word5, Word6, Word7);
        Caller.Params[1]:=Word1;
        Caller.Params[2]:=Word2;
        Caller.Params[3]:=Word3;
        Caller.Params[4]:=Word4;
        Caller.Params[5]:=Word5;
        Caller.Params[6]:=Word6;
        Caller.Params[7]:=Word7;
      end else
      if MethodName = 'ENCODEDATEWEEK' then
      result := EncodeDateWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else
      if MethodName = 'DECODEDATEWEEK' then
      begin
        DecodeDateWeek(Caller.Params[0], Word1, Word2, Word3);
        Caller.Params[1]:=Word1;
        Caller.Params[2]:=Word2;
        Caller.Params[3]:=Word3;
      end else
      if MethodName = 'ENCODEDATEDAY' then
      result := EncodeDateDay(Caller.Params[0], Caller.Params[1])
      else
      if MethodName = 'DECODEDATEDAY' then
      begin
        DecodeDateDay(Caller.Params[0], Word1, Word2);
        Caller.Params[1]:=Word1;
        Caller.Params[2]:=Word2;
      end else
      if MethodName = 'ENCODEDATEMONTHWEEK' then
      result := EncodeDateMonthWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else
      if MethodName = 'DECODEDATEMONTHWEEK' then
      begin
        DecodeDateMonthWeek(Caller.Params[0], Word1, Word2, Word3, Word4);
        Caller.Params[1]:=Word1;
        Caller.Params[2]:=Word2;
        Caller.Params[3]:=Word3;
        Caller.Params[4]:=Word4;
      end else
      if MethodName = 'TRYENCODEDATETIME' then
      begin
        result := TryEncodeDateTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4], Caller.Params[5], Caller.Params[6], DT);
        Caller.Params[7]:=DT;
      end else
      if MethodName = 'TRYENCODEDATEWEEK' then
      begin
        result := TryEncodeDateWeek(Caller.Params[0], Caller.Params[1], DT, Caller.Params[3]);
        Caller.Params[2]:=DT;
      end else
      if MethodName = 'TRYENCODEDATEDAY' then
      begin
        result := TryEncodeDateDay(Caller.Params[0], Caller.Params[1], DT);
        Caller.Params[2]:=DT;
      end else
      if MethodName = 'TRYENCODEDATEMONTHWEEK' then
      begin
        result := TryEncodeDateMonthWeek(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], DT);
        Caller.Params[4] := DT;
      end else  
      if MethodName = 'RECODEYEAR' then
      result := RecodeYear(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODEMONTH' then
      result := RecodeMonth(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODEDAY' then
      result := RecodeDay(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODEHOUR' then
      result := RecodeHour(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODEMINUTE' then
      result := RecodeMinute(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODESECOND' then
      result := RecodeSecond(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODEMILLISECOND' then
      result := RecodeMilliSecond(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'RECODEDATE' then
      result := RecodeDate(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else  
      if MethodName = 'RECODETIME' then
      result := RecodeTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4])
      else  
      if MethodName = 'RECODEDATETIME' then
      result := RecodeDateTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4], Caller.Params[5], Caller.Params[6], Caller.Params[7])
      else  
      if MethodName = 'TRYRECODEDATETIME' then
      begin
        result := TryRecodeDateTime(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4], Caller.Params[5], Caller.Params[6], Caller.Params[7], DT);
        Caller.Params[8]:=DT;
      end else
      if MethodName = 'COMPAREDATETIME' then
      result := integer(CompareDateTime(Caller.Params[0], Caller.Params[1]))
      else  
      if MethodName = 'SAMEDATETIME' then
      result := SameDateTime(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'COMPAREDATE' then
      result := integer(CompareDate(Caller.Params[0], Caller.Params[1]))
      else
      if MethodName = 'SAMEDATE' then
      result := SameDate(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'COMPARETIME' then
      result := integer(CompareTime(Caller.Params[0], Caller.Params[1]))
      else
      if MethodName = 'SAMETIME' then
      result := SameTime(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'NTHDAYOFWEEK' then
      result := NthDayOfWeek(Caller.Params[0])
      else
      if MethodName = 'DECODEDAYOFWEEKINMONTH' then
      begin
        DecodeDayOfWeekInMonth(Caller.Params[0], Word1, Word2, Word3, Word4);
        Caller.Params[1]:=Word1;
        Caller.Params[2]:=Word2;
        Caller.Params[3]:=Word3;
        Caller.Params[4]:=Word4;
      end else
      if MethodName = 'ENCODEDAYOFWEEKINMONTH' then
      result := EncodeDayOfWeekInMonth(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else  
      if MethodName = 'TRYENCODEDAYOFWEEKINMONTH' then
      begin
        result := TryEncodeDayOfWeekInMonth(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], DT);
        Caller.Params[4]:=DT;
      end else
      if MethodName = 'INVALIDDATETIMEERROR' then
        InvalidDateTimeError(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3], Caller.Params[4], Caller.Params[5], Caller.Params[6], Caller.Params[7])
      else  
      if MethodName = 'INVALIDDATEWEEKERROR' then
        InvalidDateWeekError(Caller.Params[0], Caller.Params[1], Caller.Params[2])
      else  
      if MethodName = 'INVALIDDATEDAYERROR' then
        InvalidDateDayError(Caller.Params[0], Caller.Params[1])
      else  
      if MethodName = 'INVALIDDATEMONTHWEEKERROR' then
        InvalidDateMonthWeekError(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else  
      if MethodName = 'INVALIDDAYOFWEEKINMONTHERROR' then
        InvalidDayOfWeekInMonthError(Caller.Params[0], Caller.Params[1], Caller.Params[2], Caller.Params[3])
      else  
      if MethodName = 'DATETIMETOJULIANDATE' then
      result := DateTimeToJulianDate(Caller.Params[0])
      else  
      if MethodName = 'JULIANDATETODATETIME' then
      result := JulianDateToDateTime(Caller.Params[0])
      else  
      if MethodName = 'TRYJULIANDATETODATETIME' then
      begin
        result := TryJulianDateToDateTime(Caller.Params[0], DT);
        Caller.Params[1]:=DT;
      end else
      if MethodName = 'DATETIMETOMODIFIEDJULIANDATE' then
      result := DateTimeToModifiedJulianDate(Caller.Params[0])
      else  
      if MethodName = 'MODIFIEDJULIANDATETODATETIME' then
      result := ModifiedJulianDateToDateTime(Caller.Params[0])
      else  
      if MethodName = 'TRYMODIFIEDJULIANDATETODATETIME' then
      begin
        result := TryModifiedJulianDateToDateTime(Caller.Params[0], DT);
        Caller.Params[1]:=DT;
      end else
      if MethodName = 'DATETIMETOUNIX' then
        result := DateTimeToUnix(VarAsType(Caller.Params[0],varInt64))
      else
      if MethodName = 'UNIXTODATETIME' then
        result := UnixToDateTime(VarAsType(Caller.Params[0],varInt64))
    end;
    
    initialization
      fsRTTIModules.Add(TFunctions);
    
    end.
    

Оставить комментарий

Многофункциональный текстовый редактор. Чтобы отредактировать стиль параграфа, нажмите TAB, чтобы перейти к меню абзаца. Там вы можете выбрать стиль. По умолчанию не выбран ни один стиль. Когда вы выберете текст, появится встроенное меню форматирования. Нажмите TAB, чтобы войти в него. Некоторые элементы, такие как многофункциональные вставки ссылок, картинок, индикаторов загрузки и сообщений об ошибок могут быть вставлены в редактор. Вы можете перемещаться по ним, используя стрелки внутри редактора и удалять с помощью клавиш delete или backspace.