appie21 Active Member Licensed User Longtime User Sep 27, 2016 #1 Hello i have a program that mus do a thing when 3 things are true so I wrote If EditLampInfo.Text.Contains("9") == vrresuilt.Contains("my ") == vrresuilt.Contains("hello") Then log("ökay") End If I get the eeroor Word = What is wrong with this?
Hello i have a program that mus do a thing when 3 things are true so I wrote If EditLampInfo.Text.Contains("9") == vrresuilt.Contains("my ") == vrresuilt.Contains("hello") Then log("ökay") End If I get the eeroor Word = What is wrong with this?
JordiCP Expert Licensed User Longtime User Sep 27, 2016 #2 I have never seen "==" as a logical OR. Perhaps you were looking for the logical C/Java-style "OR" , which is "||" ? Should be B4X: If EditLampInfo.Text.Contains("9") OR vrresuilt.Contains("my ") OR vrresuilt.Contains("hello") Then log("ökay") End If Upvote 0
I have never seen "==" as a logical OR. Perhaps you were looking for the logical C/Java-style "OR" , which is "||" ? Should be B4X: If EditLampInfo.Text.Contains("9") OR vrresuilt.Contains("my ") OR vrresuilt.Contains("hello") Then log("ökay") End If
fixit30 Active Member Licensed User Longtime User Sep 27, 2016 #3 JordiCP said: If EditLampInfo.Text.Contains("9") OR vrresuilt.Contains("my ") OR vrresuilt.Contains("hello") Then log("ökay") End If Click to expand... This will return True if only one is matched not all three as per the OP request. Maybe it should be B4X: If EditLampInfo.Text.Contains("9") AND vrresuilt.Contains("my ") And vrresuilt.Contains("hello") Then log("ökay") End If Upvote 0
JordiCP said: If EditLampInfo.Text.Contains("9") OR vrresuilt.Contains("my ") OR vrresuilt.Contains("hello") Then log("ökay") End If Click to expand... This will return True if only one is matched not all three as per the OP request. Maybe it should be B4X: If EditLampInfo.Text.Contains("9") AND vrresuilt.Contains("my ") And vrresuilt.Contains("hello") Then log("ökay") End If
JordiCP Expert Licensed User Longtime User Sep 27, 2016 #4 fixit30 said: This will return True if only one is matched not all three. Click to expand... Oops! Totally agree, I misread it Upvote 0
fixit30 said: This will return True if only one is matched not all three. Click to expand... Oops! Totally agree, I misread it