tufanv Expert Licensed User Longtime User Mar 25, 2014 #1 hi I have the code : B4X: If days>48 Then lbl1.text = "ok" end if I want to add something to this code : I want to check if days>48 but not 168. To describe shortly if days = 168 i dont want the above code to execute. so i tried to use if days>48 and not days=168 then ... but it didnt work . How can i do that TY
hi I have the code : B4X: If days>48 Then lbl1.text = "ok" end if I want to add something to this code : I want to check if days>48 but not 168. To describe shortly if days = 168 i dont want the above code to execute. so i tried to use if days>48 and not days=168 then ... but it didnt work . How can i do that TY
J JoeR Member Licensed User Longtime User Mar 25, 2014 #2 I am not a great expert, so I hope somebody else will do a double-check, but I think the following will work. B4X: If days>48 AND days<>168 Then lbl1.text = "ok" End If Upvote 0
I am not a great expert, so I hope somebody else will do a double-check, but I think the following will work. B4X: If days>48 AND days<>168 Then lbl1.text = "ok" End If
RandomCoder Well-Known Member Licensed User Longtime User Mar 25, 2014 #3 tufanv said: hi I have the code : B4X: If days>48 Then lbl1.text = "ok" end if I want to add something to this code : I want to check if days>48 but not 168. To describe shortly if days = 168 i dont want the above code to execute. so i tried to use if days>48 and not days=168 then ... but it didnt work . How can i do that TY Click to expand... You can use "If days>48 And days<>168 Then" Regards, RandomCoder Upvote 0
tufanv said: hi I have the code : B4X: If days>48 Then lbl1.text = "ok" end if I want to add something to this code : I want to check if days>48 but not 168. To describe shortly if days = 168 i dont want the above code to execute. so i tried to use if days>48 and not days=168 then ... but it didnt work . How can i do that TY Click to expand... You can use "If days>48 And days<>168 Then" Regards, RandomCoder
RandomCoder Well-Known Member Licensed User Longtime User Mar 25, 2014 #5 I would have written this earlier but wanted to test it first, you can also use the following code which makes use of the Not keyword... B4X: If days>48 AND Not(days=168) Then I think that the reason it didn't work for you previously is that you need to contain the boolean logic in brackets after the Not keyword. Kind regards, RandomCoder Upvote 0
I would have written this earlier but wanted to test it first, you can also use the following code which makes use of the Not keyword... B4X: If days>48 AND Not(days=168) Then I think that the reason it didn't work for you previously is that you need to contain the boolean logic in brackets after the Not keyword. Kind regards, RandomCoder