Beginner VB

Moderators: None (Apply to moderate this forum)
Number of threads: 1233
Number of posts: 2978

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Problems to be solved by visual basic..Pls.Help me Posted by simpleprettyme on 18 Jun 2009 at 6:31 AM
hello!!
im just new in this field,im still studying as computer programmer in a Tesda school here in our town..

here's the problem,,i hope you can help me solve this tonight..

A car travelled 10 minutes in gravel,15 minutes in sand, 20 minutes in asphalt, 25 minutes in mud..
How can i run this,,that when i type for example 27 minutes so the car will be on the asphalt,,when i type the number of minute the corresponding place will appear in the textbox..

pls help me..pls..
thanks...(",)


**sumtimes we need to break the rules and follow apart,***
Report
Re: Problems to be solved by visual basic..Pls.Help me Posted by MrWhiskers on 5 Apr 2010 at 8:36 PM
im sorry im not following what you are asking.

please explain a lil better.
Report
Re: Problems to be solved by visual basic..Pls.Help me Posted by D3 on 17 May 2010 at 3:33 PM
If I were you, I would use and If, Then, Else Statement, or a Case Select statement. I'm not sure what the coding would be on your version of VB, but on mine the if/then/else is this

dim minutes as integer

if minutes < 10 and > 0 then
messagebox.show("gravel")
ElseIf minutes > 10 and < 25 then
messagebox.show("sand")


and so forth until

ElseIf minutes > 70 then
messagebox.show("insert some message")

You can also use just Else for the last one

Where I put a message box, you put whatever code the instructor wants

You can also use a case selection structure, but I don't recall that one quite as well.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.