473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Operation with timespan and integers

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

Nov 21 '05 #1
2 1136
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!
"N! Xau" <nx**@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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

Nov 21 '05 #2
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
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jeroen CEuppens | last post by:
Hi, I want to have a timer that counts how long it takes to draw 2 bitmap files...... I use the compact framework, so I haven't got System.Timers Please help me... Greetz JC
2
by: DWalker | last post by:
In Visual Studio (Visual Basic) .NET 2002, I noticed that this: Dim Elapsed as DateTime = Now - Now gives a "compile time" error (error in the IDE), saying that the '-' operator is not...
10
by: Charles Law | last post by:
If I display a TimeSpan I get something like 00:05:17.6217891 when what I would like to see is 00:05:18 Is there an easy way to get this output? Try as I might I just can't find it.
10
by: David R. | last post by:
I want to do bitwise operation on some large integers. For example, Response.Write CBool(2 AND 2^30) ' returns False Response.Write CBool(2 AND 2^31) ' CRASHED! Looks like the AND...
2
by: Dennis D. | last post by:
Hello: I want to subtract a timespan from the selectionrange.start of a month calendar. The selectionrange.start of a month calendar is a date, and it is possible to subtract a timespan from a...
13
by: sd00 | last post by:
Hi all, can someone give me some coding help with a problem that *should* be really simple, yet I'm struggling with. I need the difference between 2 times (Target / Actual) However, these times...
24
by: Nishu | last post by:
Hi All, Could you please explain whether C standard supports logical right shift operation using some operator? I know somewhere I read about >>operator. I thought, it is in C but i think i'm...
4
by: Peter Proost | last post by:
Hi group, it's been a long time since the last time I've been here but I have a question. I'm working with timespan.parse for calculating a duration, I have to add strings which are in the...
6
by: Frank Hauptlorenz | last post by:
Hello out there, I have 2 services running. The first one runs in session mode and the 2nd not. The first one should call an operation of the 2nd one asynchronously, because this is doing some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.