put [CODE][/CODE] or [HIGHLIGHT=VB][/HIGHLIGHT] tags around the code...
for starters though.... these two lines shouldn't work....
Code:
If input(Number) = True Then
Number = Val(Number)
The first should produce a compile error...
Input is going to be a string because that's what Console.ReadLine() returns.
Number is an integer, but hasn't been assigned a value yet so it's not really valid...
Then you have Number = Val(Number) ... but Number is still empty, and even if it did, it would already be an integer (because that's what Number has been defined as) ... making Number = Val(Number) redundant.
I'm guessing that's not really what you wanted....
Try this instead:
Code:
If Integer.TryParse(Input, Number) Then
If Number < 1 Or Number > 100 Then
If Number > 100 Then
This condition will never run:
Code:
ElseIf Number >= 1 And Number <= 100 Then
It is found inside the first check for out of bounds...
here's a little quick restructuing:
Code:
If Integer.TryParse(Input, Number) Then
If Number < 1 then
console.writeline("Value too small")
Display = "Value entered is not between 1 and 100"
elseif Number > 100 then
console.writeline("Value too large")
Display = "Value entered is not between 1 and 100"
else ' No need for any further checking we know it's between 1 and 100
Process1.Enabled = False
End If
Else
Display = " You did not enter a numerical value "
End If
-tg