ciginfo Well-Known Member Licensed User Longtime User Aug 8, 2011 #1 Bonjour. How to code this with B4A ?? Thank you Dim x as int Select x x > 5 Label1.Text = "Plus grand que 5" x < 5 Label1.Text = "Plus petit que 5" End select
Bonjour. How to code this with B4A ?? Thank you Dim x as int Select x x > 5 Label1.Text = "Plus grand que 5" x < 5 Label1.Text = "Plus petit que 5" End select
A admac231 Active Member Licensed User Longtime User Aug 8, 2011 #2 Unfortunately B4A doesn't support comparison operators in Select Case. You could use: Code: Dim x as int Select x Case 1,2,3,4,5 Label1.Text = "Plus petit que 5" Case Else Label1.Text = "Plus grand que 5" End select or use if - elseif. Upvote 0
Unfortunately B4A doesn't support comparison operators in Select Case. You could use: Code: Dim x as int Select x Case 1,2,3,4,5 Label1.Text = "Plus petit que 5" Case Else Label1.Text = "Plus grand que 5" End select or use if - elseif.
klaus Expert Licensed User Longtime User Aug 8, 2011 #3 C'est simple: Code: If x > 5 then Label1.Text = "Plus grand que 5" Else If x < 5 Then Label1.Text = "Plus petit que 5" End If Meilleures salutations. Upvote 0
C'est simple: Code: If x > 5 then Label1.Text = "Plus grand que 5" Else If x < 5 Then Label1.Text = "Plus petit que 5" End If Meilleures salutations.
ciginfo Well-Known Member Licensed User Longtime User Aug 8, 2011 #4 Oui bien sur, mais j'ai plusieurs conditions et avec VB le Select case est plus pratique. Conditions : If x >5 and x <10 If x >10 and x <15 If x >15 and x <20 If x >20 and x <25 If x >25 and x <30 etc.. Tant pis je vais faire avec If ... Then... Merci beaucoup pour a rapidité de ces réponses Upvote 0
Oui bien sur, mais j'ai plusieurs conditions et avec VB le Select case est plus pratique. Conditions : If x >5 and x <10 If x >10 and x <15 If x >15 and x <20 If x >20 and x <25 If x >25 and x <30 etc.. Tant pis je vais faire avec If ... Then... Merci beaucoup pour a rapidité de ces réponses
klaus Expert Licensed User Longtime User Aug 8, 2011 #5 Malheureusement la fonction Select / Case dans B4A n'accepte pas toutes les possibilités de VB6. Meilleures salutations. Upvote 0
Malheureusement la fonction Select / Case dans B4A n'accepte pas toutes les possibilités de VB6. Meilleures salutations.
K kickaha Well-Known Member Licensed User Longtime User Aug 8, 2011 #6 If your steps are 5 at a time try dividing by 5: Code: Dim temp As Double temp = Floor (x/5) Select temp Case 0 ' x was less than 5 Label1.Text = "Plus petit que 5" Case 1 ' x was between 5 and 10 Label1.Text = "Plus grand que 5" End select Extend as needed Upvote 0
If your steps are 5 at a time try dividing by 5: Code: Dim temp As Double temp = Floor (x/5) Select temp Case 0 ' x was less than 5 Label1.Text = "Plus petit que 5" Case 1 ' x was between 5 and 10 Label1.Text = "Plus grand que 5" End select Extend as needed
Djembefola Active Member Licensed User Longtime User Aug 8, 2011 #7 You can use Select Case True Code: Select Case true Case (x<5) Label1.Text = "Plus petit que 5" Case Else Label1.Text = "Plus grand que 5" End Select Upvote 0
You can use Select Case True Code: Select Case true Case (x<5) Label1.Text = "Plus petit que 5" Case Else Label1.Text = "Plus grand que 5" End Select