Operation with timespan and integers

  • Thread starter Thread starter N! Xau
  • Start date Start date
N

N! Xau

Hi,

I have this test:
If Now().Subtract(AlBoxOutTime(0)) > Math.Ceiling(8 / 10 * AlBolPS(0) *
AlTimerInt(0)) Then

What I want to do is to test if the time difference between now() and a
previous date AlBoxOutTime(0) is bigger than the result of that right
member.

AlBoxOutTime is an arraylist of date
AlBolPS just an arraylist of integers
AlTimerInt is an arraylist that stores the interval of some timers:
AlTimerInt.Add(TimerL1.Interval)
AlTimerInt.Add(TimerL2.Interval)
AlTimerInt.Add(TimerL3.Interval)

I get "invalid operator for type timespan and double"

Thanks for help
N! Xau
 
AlBoxOutTime is a time whereas Math.Ceiling(<expr>) is presumably a Double.
These two are incompatible. Either both need to be Double or both need to
be time. I'm not sure what you are doing on the right side of your
equation!
 
Hi,

Now().Subtract(...) is TimeSpan.
Math.Ceiling(...) is Double.

What should you do depends on what do you want to compare.

Tick count? Use Subtract(...).Ticks.
Seconds? Use Subtract(...).TotalSeconds.

I hope you got the idea.

Roman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top