Here you have an example.
You must check all the cells in column "B" if they fit the requested value.
The sample program looks also for multiple findings.
Actually I don't need it, first I find the data and then comes the loop.
But I was wondering if the mobile devices are able to manage such kind of work, I'm doing some tests in a PocketPC and in a modern WM 6.5 phone, and I want good performance in both.
For example in the PocketPC it seems it refresh the info almost every second, although the interval of the timer is 100ms.
Using a timer will not increase the performance of the system.
The Timer ticks are updated only every second, but the execution of code does't depend on that.
You can experience this when you have an operation the display is updated after completion of it. When you have a long operation then the system hangs up until completion of the operation, in this case if you want an update you must use the DoEvents statement.
Diego, what do you need the timer for? Timers are used to carry out some operation in the background. For example: you have the table and the user refreshing it, and you can use a timer to check for database updates in the background. What is your need?
I need a timer because the program is a chronometer that looks for an "event" in the table every tick, for example,
I start the chrono and in my table I have "at 8:00 have breakfast,at 11:00 have lunch, etc." I need to seek every time in which position of the table am I. The event can happen at a part of a second, so I need the maximum accuracy.
So finally I have a Do-Loop in the timer_tick.
¿if I put the DoEvents statement in the Do..Loop I would "free" the timer until next tick?
No, this is not a very good idea.
Generally, you should try avoid using the DoEvents method. If you did you should have good reason, as it tends to cause performance penalty and there are usually ways to work around it. Using a Do-Loop in a timer is also not a very good idea due to the same reason.
A timer raises a certain sub every tick (x milliseconds). This sub can then do anything. I guess you've seen how it works. In your case, what you need is that the timer will seek the next time on a schedule and do something if it has arrived. I think it's best to look for the next thing to happen (in the table) when the previous ends and when the table updates. This way the timer only needs to compare the time now to a saved time and this is very quick.
"Now" on a device only increments once per second so you cannot tell the time more accurately that that. A Timer however can tick more often than once per second.Why would you need more accuracy than a second? For the application you describe isn't it sufficient to test for "later than" to check an event time has arrived. I would have thought a check every few seconds was enough.
Ariel, I think you're right. I've removed the loop and added a variable as a pointer, If (Now) is greater than the time in the pointer, I move to the next row in the table. It seems it works.
Anyway in my old PocketPC 2002 (updated to 2003) with NetCF 2.0 I see a flicker that doesn't appear in the WM 6.5 phone.
The application is a kind of ability game (or will be,I hope)