hello!我的想法是判断如果当前时间在10:00到21:00之间就执行某个指标,但是找不到相应的函数。如下这个是api中提供的范例,但是在Delphi 7中没有Hour这个函数,我现在写的代码是这个,但是加载到FT2后长时间无响应。我不是程序员,所以不是很理解问题出在什么地方。请看看可否帮忙,或者麻烦提供下正确的代码。非常感谢!
var
hh,mm,ss,ms: Word;
DecodeTime(TimeCurrent, hh, mm, ss, ms);
while ((hh>9) and (hh<22)) do
begin
.............
end;
------------------------------------------
以下是软件api中的范例。
Delphi
if Hour(TimeCurrent) <> 22 then …
Help.How to get hours of current time?
-
- Posts: 4
- Joined: Sun Sep 09, 2012 4:21 am
Help.How to get hours of current time?
Last edited by martin.Z on Fri Oct 19, 2012 10:45 pm, edited 1 time in total.
-
- Posts: 905
- Joined: Sat Jul 11, 2009 10:54 am
-
- Posts: 4
- Joined: Sun Sep 09, 2012 4:21 am
-
- Posts: 103
- Joined: Sun Jan 02, 2011 6:05 pm
martin.Z wrote:hello£¡
It is not the ¡°Hour¡± this function in Delphi 7, how to get hours of current time?examples?
Thank you very much£¡
This api example is the old£¬Compile error¡£
-------
Delphi
function TimeCurrent: TDateTime;
Example:
Delphi
if Hour(TimeCurrent) <> 22 then ¡
use DateUtils;
if HourOf(TimeCurrent) <> 22 then ¡
will not go to sleep
else
the same problem you faced was answered in the following
http://www.forextester.com/forum/viewto ... ght=hourof
hi FT,
I can understand why Martin Z. facing this problem.
Look at your user guide, the mistake still not updated.
The HourOf function is used in the C++ not in the delphi.
Who is online
Users browsing this forum: No registered users and 3 guests