Simple problem
-
:((Hello everyone. I've got a very small problem, for most of you this could be very stupid, but hey I'm new in the programming world. I need to create a small program using VB 6.0 but I have a small problem with it. Here it goes, I have a form with a command button, when clicked is gonna open an inputbox asking for a value, but I need to say that if the value is less than 45 please display a word, if it's equal or greater than 45 but less than 60 display a different word, if it's equal or greater than 60 but less than 70 display another word and if it's equal or greater than 70 but less than 80 display other word. I've got something like this in the code: dim weight as single weight = inputBox("Please type weight...") If weight < 45 then label.Caption = "reject" Else If weight >= 45 ... HERE IS WHERE I HAVE THE PROBLEM, i DON'T KNOW HOW TO WRITE THIS STATEMENT WITH the two values label.Caption = "Small" Else If weigh ...the same ... label.caption = "medium" Else (...) End if End if End if Please help me!!! thanks very much for any help ASP.NET capo
-
:((Hello everyone. I've got a very small problem, for most of you this could be very stupid, but hey I'm new in the programming world. I need to create a small program using VB 6.0 but I have a small problem with it. Here it goes, I have a form with a command button, when clicked is gonna open an inputbox asking for a value, but I need to say that if the value is less than 45 please display a word, if it's equal or greater than 45 but less than 60 display a different word, if it's equal or greater than 60 but less than 70 display another word and if it's equal or greater than 70 but less than 80 display other word. I've got something like this in the code: dim weight as single weight = inputBox("Please type weight...") If weight < 45 then label.Caption = "reject" Else If weight >= 45 ... HERE IS WHERE I HAVE THE PROBLEM, i DON'T KNOW HOW TO WRITE THIS STATEMENT WITH the two values label.Caption = "Small" Else If weigh ...the same ... label.caption = "medium" Else (...) End if End if End if Please help me!!! thanks very much for any help ASP.NET capo
If weight >= 45 And weight<60 Then 'Value between 44 & 60 End if
-
If weight >= 45 And weight<60 Then 'Value between 44 & 60 End if
Actually to get a value between 45 and 60 you need to write:
If weight >= 45 And weight <= 60 Then
'Value between 44 & 60
End IfIf you leave out the = in the second '<= 60' you only get the values between 45 and 59.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
-
Actually to get a value between 45 and 60 you need to write:
If weight >= 45 And weight <= 60 Then
'Value between 44 & 60
End IfIf you leave out the = in the second '<= 60' you only get the values between 45 and 59.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
Don't you guys just live for the simple questions? :laugh:
-
Don't you guys just live for the simple questions? :laugh:
Thanks you guys you people are very kind, Thanks, that's one part of an assignment that is due today. I'm very happy thanks to you, I owe u heaps! But now I need more help PLEASE; it's from the same exercise. I need to make a loop until the value 0 is input, then print the total number of items weighted. for that i created a variable called counter as int. dim counter as integer Counter = 0 do until weight = 0 Counter = counter + 1 Loop weight = inputbox(...) (...code you guys gave me goes here) Loop End If (...) When I try to run it I get a runtime error '6', Overflow, but I have no idea what I'm doing wrong, please give a hand with that THANKS AGAIN! Cheers, IJ:-D ASP.NET capo