F Fox Active Member Licensed User Longtime User Jul 29, 2011 #1 How can i make an if statement between to numbers... I mean if i have an number for example 6 and would say if the calculatet number is between 6.0 and 7.0 then... how can i code this...
How can i make an if statement between to numbers... I mean if i have an number for example 6 and would say if the calculatet number is between 6.0 and 7.0 then... how can i code this...
Cableguy Expert Licensed User Longtime User Jul 29, 2011 #2 you can use : if x>6.0 or x<7.1 then Upvote 0
F Fox Active Member Licensed User Longtime User Jul 29, 2011 #3 Cableguy said: you can use : if x>6.0 or x<7.1 then Click to expand... wow thanks cool thats so simple but I'm a totally beginner Thank you very much Upvote 0
Cableguy said: you can use : if x>6.0 or x<7.1 then Click to expand... wow thanks cool thats so simple but I'm a totally beginner Thank you very much
A admac231 Active Member Licensed User Longtime User Jul 29, 2011 #4 You would have to change the 'Or' to 'And' there to ensure the number is both above 6 and below 7, rather than either. Code: Copy If x >= 6 AND x <= 7 Then Upvote 0
You would have to change the 'Or' to 'And' there to ensure the number is both above 6 and below 7, rather than either. Code: Copy If x >= 6 AND x <= 7 Then
F Fox Active Member Licensed User Longtime User Jul 29, 2011 #5 admac231 said: You would have to change the 'Or' to 'And' there to ensure the number is both above 6 and below 7, rather than either. Code: Copy If x >= 6 AND x <= 7 Then Click to expand... hmmm this works not at me: If lbl_hc.Text <= 6 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "en.png") Else If lbl_hc.Text >= 6 AND <= 7 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "au.png") Else If lbl_hc.Text >= 7 AND <= 9 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "la.png") Else If lbl_hc.Text >= 9 AND <= 20 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "ot.png") End If gets me follow error: Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 630 Else If lbl_hc.Text >= 6 AND <= 7 Then Word: and Upvote 0
admac231 said: You would have to change the 'Or' to 'And' there to ensure the number is both above 6 and below 7, rather than either. Code: Copy If x >= 6 AND x <= 7 Then Click to expand... hmmm this works not at me: If lbl_hc.Text <= 6 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "en.png") Else If lbl_hc.Text >= 6 AND <= 7 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "au.png") Else If lbl_hc.Text >= 7 AND <= 9 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "la.png") Else If lbl_hc.Text >= 9 AND <= 20 Then ImageView1.Bitmap = LoadBitmap(File.DirAssets, "ot.png") End If gets me follow error: Compiling code. Error Error compiling program. Error description: Missing parameter. Occurred on line: 630 Else If lbl_hc.Text >= 6 AND <= 7 Then Word: and
A admac231 Active Member Licensed User Longtime User Jul 29, 2011 #6 After the 'AND' you need to rewrite the condition e.g Code: Copy Else If lbl_hc.Text >= 6 AND <= 7 Then becomes: Code: Copy Else If lbl_hc.Text >= 6 AND lbl_hc.Text <= 7 Then Upvote 0
After the 'AND' you need to rewrite the condition e.g Code: Copy Else If lbl_hc.Text >= 6 AND <= 7 Then becomes: Code: Copy Else If lbl_hc.Text >= 6 AND lbl_hc.Text <= 7 Then
F Fox Active Member Licensed User Longtime User Jul 29, 2011 #7 admac231 said: After the 'AND' you need to rewrite the condition e.g Code: Copy Else If lbl_hc.Text >= 6 AND <= 7 Then becomes: Code: Copy Else If lbl_hc.Text >= 6 AND lbl_hc.Text <= 7 Then Click to expand... ohhh that works thank you ... ahhh first i have make it then not... ohhh the error with an simple logic error... Upvote 0
admac231 said: After the 'AND' you need to rewrite the condition e.g Code: Copy Else If lbl_hc.Text >= 6 AND <= 7 Then becomes: Code: Copy Else If lbl_hc.Text >= 6 AND lbl_hc.Text <= 7 Then Click to expand... ohhh that works thank you ... ahhh first i have make it then not... ohhh the error with an simple logic error...