English 中文(简体)
Delphi TDate 时间变量不会在2010年德尔菲启动
原标题:Delphi TDateTime variable will not initialize in Delphi 2010

我在2010年Delphi建立了一个简单的表格,在纽伦的第一号法典中有一个纽芬兰语:

procedure TForm1.Button1Click(Sender: TObject);
var
     myDateTime:TDateTime;
begin
     myDateTime:=now; // shows as 12/30/99 in debugger
end;

当我在Delphi XE2管理这一准确的法典时,我获得目前时间/时间的价值。

我认为,我在2010年德尔菲项目环境中必须有一些错误的说法,但不能认为可能是什么。

任何帮助都会受到高度赞赏。

感谢!

发现的问题,编纂者的背景是,《守则》的产生优化规定是真实的,其价值显然是作为TDatetime的违约。 当我把优化环境变成虚假时,我可以看到这种价值。

问题回答

I think the reason you are not seeing myDateTime is that it never gets used.
As such it is a candidate for dead code removal.
Obviously removed code cannot be executed and you can not see the value.

如果你不赞成优化你的(无用的)法典,就不去掉,你可以看到var已经填满。





相关问题
determining the character set to use

my delphi 2009 app has a basic translation system that uses GNUGetText. i had used some win API calls to prepare the fonts. i thought it was working correctly until recently when someone from Malta ...

Help with strange Delphi 5 IDE problems

Ok, I m going nuts here. For the last (almost) four years, I ve been putting up with some extremely bad behavior from my Delphi 5 IDE. Problems include: Seemingly random errors in coride50.bpl ...

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How convert string to integer in Oxygene

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn t appear to be part of Oxygene, and I can ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签