|
-
Oct 12th, 2012, 12:42 PM
#7
New Member
Re: None of my If statements are executing.
Hello everyone, I'm working on a class assignment that has a user input numerical values for a geometry calculator and then it displays the answers in console mode. I wanted to expand on the program by using if then statements. I found the examples above very helpful, but I am still not able to construct what I need to work. And Yes, this is my first time in the forum and working with VB so take it easy on the green horn. Here is what I have put together, any assistance would be greatly appreciated. I was unable to find a way to cut and paste the code the same way that was used else where..Sorry
Thanks
Sub Main()
Dim Number As Integer
Dim Display As String
Console.WriteLine("Please input a number")
Dim input = Console.ReadLine()
If input(Number) = True Then
Number = Val(Number)
If Number < 1 Or Number > 100 Then
If Number > 100 Then
Console.WriteLine(" The Number You entered is too high")
ElseIf Number < 1 Then
Console.WriteLine(" The Number You entered is too low")
ElseIf Number >= 1 And Number <= 100 Then
Process1.Enabled = False
End If
Else
Display = " The number you entered is not between 1 and 100"
End If
Else
Display = " You did not enter a numerical value "
End If
End Sub[HIGHLIGHT]Sub Main()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|