Although Select cases and if-else statements are interchangeable, if-statements aren't good practice for a large number of different conditions. Select cases also deal with executing code based on a single variable's value so organizationally it is better for that particular instance.
but...what is the difference between if statement and select case in application? Why do we have to learn them both instead of learning the if statement only?
help me with this situation i have a textbox and radio button 1 and radio button 2.. i want to make auto check radio button using case statement i want to make the program read the last number when user key in the textbox case is =0,2,4,6,8 radiobutton1 = True radiobutton2 = False case is =1,3,5,7,9 radiobutton1 = False radiobutton2 = True I cannot find a way to read the last number in the textbox..please help me
same result with if statement Console.WriteLine("enter a integer") Dim a As Integer = Console.ReadLine If a = 0 Then Console.WriteLine("hello") Else If a = 1 Then Console.WriteLine("bye") End If End If If a = 2 Then Console.WriteLine("goodmorning") End If Console.ReadLine()
Although Select cases and if-else statements are interchangeable, if-statements aren't good practice for a large number of different conditions. Select cases also deal with executing code based on a single variable's value so organizationally it is better for that particular instance.
Very useful!
but...what is the difference between if statement and select case in application? Why do we have to learn them both instead of learning the if statement only?
Thanks this is very helpfull
help me with this situation
i have a textbox and radio button 1 and radio button 2..
i want to make auto check radio button using case statement
i want to make the program read the last number when user key in the textbox
case is =0,2,4,6,8
radiobutton1 = True
radiobutton2 = False
case is =1,3,5,7,9
radiobutton1 = False
radiobutton2 = True
I cannot find a way to read the last number in the textbox..please help me
this is so much easier than java
I didn't have that nailed down I had that screwed down!!, pun intended :)
this is the equivalent of the SWITCH in C
how can you make it so you can search multiple things in one go?
This code works just like switch in C&C++
select case must be used in some cmd programs!!!
1)Dos
2)Net bios
3)
4)
and then u type one of them to continue
May I ask what kind of programming language is used in VB? Tnx
what happens if you enter 7, for example
Dzienki za poradnik zostane na przyszlość trszmaj sie pszyjacielu
nailed it :D
Is there a default case in VB as in C++?
thanx man
is it the same as switch statement in c++?
+Misha Misha I think switch only works for integers.
VB isn't case sensitive!
🥚🥚🥚🥚
same result with if statement
Console.WriteLine("enter a integer")
Dim a As Integer = Console.ReadLine
If a = 0 Then
Console.WriteLine("hello")
Else
If a = 1 Then
Console.WriteLine("bye")
End If
End If
If a = 2 Then
Console.WriteLine("goodmorning")
End If
Console.ReadLine()
one :( Ill like it toi try and overrule him