Delphi warning - W1002 Symbol 'FileSetDate' is specific to a platform

后端 未结 3 694
囚心锁ツ
囚心锁ツ 2021-02-18 22:58

When I compile my application under Delphi 2006 I get the following warning [Pascal Warning]- W1002 Symbol \'FileSetDate\' is specific to a platform

What must I do to s

3条回答
  •  我寻月下人不归
    2021-02-18 23:35

    1) In the project options you can choose the compiler messages you want to see. If you don't care about platform independency you can just switch off the platform warning there.

    2) Another way is disabling the warning for a certain part of the code:

    {$WARN SYMBOL_PLATFORM OFF}
    // Your code
    {$WARN SYMBOL_PLATFORM ON}
    

    For a complete list of options look at the Delphi help file at the topic '$WARN'

    3) A last way would be adding

    {$WARNINGS OFF}
    // Your code
    {$WARNINGS ON}
    

    but that is dangerous, because all warnings will be suppressed.

    4) Additionally, as the other answers have already suggested, you could just switch to the platform independant variant of FileSetDate which works on file names (i.e. Strings), but as far as I understand that was not your question.

提交回复
热议问题