Rtb and timer.
-
I would like to ask if anyone knows wat is the maximum number of character a RTB can have? And wat is the maximum interval a timer can have??
Subjugate wrote:
wat is the maximum number of character a RTB can have?
Up to available memory.
Subjugate wrote:
And wat is the maximum interval a timer can have??
The depends on which Timer you're talking about. If it's the Timer in the Toolbox, then it's Int32.Max, or about 2.14 billion. If it's the Timer in the Threading namespace, then it's Int64.Max, or about 9.2 Million Trillion milliseconds. In either case, if you need to set an interval that high, you really need to rethink your design.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Subjugate wrote:
wat is the maximum number of character a RTB can have?
Up to available memory.
Subjugate wrote:
And wat is the maximum interval a timer can have??
The depends on which Timer you're talking about. If it's the Timer in the Toolbox, then it's Int32.Max, or about 2.14 billion. If it's the Timer in the Threading namespace, then it's Int64.Max, or about 9.2 Million Trillion milliseconds. In either case, if you need to set an interval that high, you really need to rethink your design.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Dave Kreskowiak wrote:
In either case, if you need to set an interval that high, you really need to rethink your design.
I agree. Though it is nice to know what the limit is, the upper bound really doesn't have any practical purpose. I can't even begin to think of anything that would need that long of a duration between ticks. Especially the 9.2 million trillion milliseconds, that is quite a few years ( ~291 million ) :laugh:
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
Subjugate wrote:
wat is the maximum number of character a RTB can have?
Up to available memory.
Subjugate wrote:
And wat is the maximum interval a timer can have??
The depends on which Timer you're talking about. If it's the Timer in the Toolbox, then it's Int32.Max, or about 2.14 billion. If it's the Timer in the Threading namespace, then it's Int64.Max, or about 9.2 Million Trillion milliseconds. In either case, if you need to set an interval that high, you really need to rethink your design.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Thanks for the ans. I wanted to know is becos my application is a 24/7 running application. i am afraid if my RTB just full and i am not aware, it might crash the application.
You don't need a Timer to go for that long. You just set it to fire once a second, then, once per minute, you can compare the current time to a "scheduled" time for a process to kick off. It's utterly pointless to have a timer going for any entire day. What if your app DOES crash, or the machine goes down or loses power?? How are you going to reset the timer to a proper schedule?? That's why you have it check against a known time, instead of a known interval. As for the size of the RTB, you really need to make sure you save off the log information to a file instead of relying on the RTB to hold onto it for you, for the very same reasons I just mentioned above. Cna you think of anything worse than losing half a days data because you didn't save each piece to a file when you received it?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008