Simplicty and flexibility!


Adding seconds to time field?


Started by Duncan Clarke
Search
You will need to Sign In to be able to add or comment on the forum!

Adding seconds to time field?

I know how to add days to a date field – you just do Date1 + 3 to increase the date by three days.

But how do you increase a time field – for instance if you have stored a time as some sort of temp field “tTime” and you want to do something with a process say 10 seconds after this time so that you have allowed enough time for a process to happen such as sending an email. How do you programme:

Timefield (value) + 10 seconds? – if you just put Timefield + 10 presumably it doesn’t know if this is seconds, minutes or hours. Do you turn it into some sort of digital time first?


Written by Duncan Clarke 14/04/17 at 10:36:32 Dataease [{8}]FIVE

Re:Adding seconds to time field?

In your question there are basically two different questions and you open a can of worms.

  • 1.Time fields.
    Time is in seconds so +10 will add 10 seconds to a time. (See below). DataEase automatically do the minutes/hours rollover so that part is easy. The first one is derivation in fields and the second one is a DQL


It does not format time fielsd (: : ) in variables but if you return it in a field it will be.

However neither of this fix your problem which is a delay.

2. Delay

In a DQL you can run a loop.

DQL

define "MyTimer" time .

message "HIt enter to start" window .

MyTimer := current time+10 .

while MyTimer>current time do

Message concat("Time Left: ",MyTimer-current time) .

end

message "That was it, now we can go on" window .

However you can also just use wait(10) .

http://www.dataease.com/dg3_HelpView/?PageID=10342&field1=*Wait*

define "Retval" text .

message "HIt enter to start" window .

retval := wait(10) .

message "That was it, now we can go on" window .


Written by DataEase 14/04/17 at 11:22:16 Dataease [{8}]FIVE
DG3_ForumList