问题
I have a program that was created in Delphi 5 and the program still runs nearly perfect on Win7 and Win8.
However, when trying to run this code in XE6 (trial version) I get two errors that I am having trouble fixing. Errors are with 'DateSeparator' and 'LongTimeFormat' with each having the error "undeclared identifier"
The code segment is as follows:
function AccurateTimeStamp:String;
begin
DateSeparator:='.';
LongTimeFormat:='hhmmsszzz';
result:=TimeToStr(Now);
end;
I am very new to Delphi but I'm pretty sure that "undeclared identifiers" mean's that the item was not identified prior in code. If this is the case, I do not know how to accomplish this. Perhaps, errors are related to a change in code format since Delphi 5.
回答1:
use FormatSettings.DateSeparator
instead of DateSeparator
来源:https://stackoverflow.com/questions/25130578/undeclared-identifier-errors-related-to-dateseparator-and-longtimeformat