Error in sDateUtils.pas: Undeclared identifier: 'ShortDateFormat'

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35950
    Mohammad
    Participant

    I just installed v8.50 on XE4, seemingly successful. But I can't build any project with alphacontrols becasue an error in sDateUtils.pas pops up (see attachment). Here is the error message: Undeclared identifier: 'ShortDateFormat'

    And this is the function in statutes that the error occurs in:

    function DefDateFormat(NormalYears: Boolean): string;

    begin

    if NormalYears then begin

    case GetDateOrder({$IFDEF DELPHI_XE3}FormatSettings.{$ENDIF}ShortDateFormat) of

    doMDY: Result := 'MM/DD/YYYY';

    doDMY: Result := 'DD/MM/YYYY';

    doYMD: Result := 'YYYY/MM/DD';

    end;

    end

    else begin

    case GetDateOrder({$IFDEF DELPHI_XE3}FormatSettings.{$ENDIF}ShortDateFormat) of

    doMDY: Result := 'MM/DD/YY';

    doDMY: Result := 'DD/MM/YY';

    doYMD: Result := 'YY/MM/DD';

    end;

    end;

    end;

    #51231
    Hamilton
    Participant

    You could probably fix it with something like this:

    Code:
    case GetDateOrder({$IF Defined(DELPHI_XE3) or Defined(DELPHI_XE4)}FormatSettings.{$IFEND}ShortDateFormat) of
    #51284
    Support
    Keymaster

    Hello Mohammad!

    The “DELPHI_XE3” key must be defined. You should find a reason why this key is Off.

    Maybe Delphi uses the old sDefs.inc file somehow?

    Try to create new project which uses sDateUtils. Will this error be there?

    I can solve this issue if you can give me a remote access to your PC.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.