Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

I am looking to create a program in VB Express that does the following: 1. Asks for a number. Example say 90.1545254556 to 10 deciamal places
2. Then Takes a timing in Milliseconds using a stop start button Example Say 4.3457633456 to 10 decimal places if possible.
3. Program Automatically gives you the answer I want it to do this (number entered) 90.1545254556 * (timing) 4.3457633456 = 391.790232164 Units - Keep this answer somewhere displayed on screen.
4. Then after the above sequences and seperate to the above sequence the program asks you to enter two timing figures the first timing reads "from" for example .9000000 (Seconds) the second timing reads "To" for example 1.100000 (seconds)
5. Then another stop start button appears after this (just one start/stop button). When you click start and then stop it measures the time and displays the time in Millieseconds and if it is between the above example timing of .9000000 to 1.100000 or whatever you entered between those two times after clicking stop it will display Ready and take no further timings. If the timings go above 1.100000 seconds then it will "out of reach" and stop and then go back to point 2.
6. Say you click start and then stop and the timer displays .8000000 seconds it is not yet in range I want the stop start button to immediately start again as soon as you click stop on the first timing. I want it to do this as many times as it takes to get into the correct range of .9000000 to 1.1000000 if it goes above 1.100000 then I want it to say out of range and stop.
7. Then after it has done this I want it to Say "start again" and go back to Point 2 keeping the original figure of 90.1545254556 that was enetered at the begiining and then start again with another timing from point 2 which might be different to 4.3457633456.

Thanks for your help, From Paul
Posted
Comments
phil.o 18-Oct-13 8:37am    
Nice requirement! And your question is?
Please see here and here.
We would be glad to help provided you put a minimum effort in what you have/want to do.

Your first problem is that it isn't going to work: no PC has a timer which works to ten significant digits of a second - not even close to that.
Your second is the Windows is not a real time operating system, so there is a huge (and variable) delay between the user doing something and it being indicated to the code - and you can't change that, it's a fundamental part of how windows works.

Having said that, look at the Stopwatch class[^] - it provides the features you need, if not the resolution.
 
Share this answer
 
Comments
Nelek 18-Oct-13 10:24am    
my 5
thatraja 18-Oct-13 11:26am    
5!
TheKingofdemon33 18-Dec-13 12:42pm    
my 5. To Member 10344423:
"Consider buying a super-computer"
It can be in any language and to two decimal places on a mac or windows. Please can someone help me. I
Thanks
 
Share this answer
 
Comments
Nelek 18-Oct-13 19:46pm    
Please don't post solutions to chat with people asking or answering. The messages are not always sorted by date, so it can be a bit difficult to follow them correctly.
The best option is to use the "Have a question or comment?" (or the tiny "reply" on another comment). Another advantage is, that the person you write to will get a notification, otherwise it could be that he/she doesn't see your additional question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900