Kev 69 Posted November 1, 2012 Report Share Posted November 1, 2012 Hi all, Here's a loop while condition I have set: Loop While:#Name1 != #Name2 OR #Address1 != Address2 So, essentially I want it to loop while either of those scenarios are equal.However, it doesnt stop looping when the condition is met. If I did those individually on their own like: Loop While:#Address1 != Address2 then it works fine. loop while(#name1 != #name2 OR #address1 != #address2) That's the code there. What's wrong with my logic?? Thanks, Kevin Quote Link to post Share on other sites
k1lv9h 76 Posted November 1, 2012 Report Share Posted November 1, 2012 Hi, Try changing the OR to AND. Kevin Quote Link to post Share on other sites
VaultBoss 310 Posted November 1, 2012 Report Share Posted November 1, 2012 The OR command equivalent in UBot Studio is EITHERTry that one... Quote Link to post Share on other sites
Kev 69 Posted November 1, 2012 Author Report Share Posted November 1, 2012 Hi, Try changing the OR to AND. Kevin As weird as tthat logic seems to be it does actually work. Kevin, how is this so? Thanks for that. Quote Link to post Share on other sites
k1lv9h 76 Posted November 1, 2012 Report Share Posted November 1, 2012 Hi, Yeah I thought it would. The use of !=.Using OR both conditions would have to be met to exit loop while.Using AND either one of the conditions are met it will exit loop while. Kevin Quote Link to post Share on other sites
Kev 69 Posted November 1, 2012 Author Report Share Posted November 1, 2012 Ah right, I get it. Thanks again Kevin Quote Link to post Share on other sites
Legend 181 Posted November 2, 2012 Report Share Posted November 2, 2012 AND and OR can be pretty confounding at first... never used EITHER... if someone has some free time I'm sure a tutorial highlighting usage and differences would be a welcome addition to the site... Quote Link to post Share on other sites
VaultBoss 310 Posted November 2, 2012 Report Share Posted November 2, 2012 Examples:A = Oven = Kitchen ApplianceB = Fridge = Kitchen ApplianceC = Garage Door = Non-Kitchen ApplianceD = Vacuum Cleaner = Non-Kitchen Appliance F = False = Logical ItemT = True = Logical Item0 = False = Logical Item1 = True = Logical Item ------------- OR = EITHER If ANY of the conditions is met, the result is TRUE COMPARE Kitchen AppliancesA OR B = TRUE .... The Oven OR the Fridge are EITHER of them, Kitchen AppliancesA OR C = TRUE .... The Oven is a Kitchen Appliance while Garage Door is a Non-Kitchen Appliance, but at least ONE of them IS!B OR C = TRUE .... The Fridge is a Kitchen Appliance while Garage Door is a Non-Kitchen Appliance, but at least ONE of them IS!C OR D = FALSE .. The Garage Door OR the Vacuum Cleaner are none of them, Kitchen Appliances Logical F OR F = F = False OR False = FALSE0 OR 0 = 0 (FALSE)F OR T = T = False OR True = TRUE 0 OR 1 = 1 (TRUE)T OR F = T = True OR False = TRUE 1 OR 0 = 1 (TRUE)T OR T = F = True OR True = TRUE1 OR 1 = 1 (TRUE) ------------- AND = BOTHIf ALL the conditions at the same time are met, the result is TRUE COMPARE Kitchen AppliancesA AND B = TRUE .... The Oven AND the Fridge are BOTH, Kitchen AppliancesA AND C = FALSE ... The Oven is a Kitchen Appliance; the Garage Door is a Non-Kitchen Appliance > NOT BOTH at the same timeB AND C = FALSE ... The Fridge is a Kitchen Appliance; the Garage Door is a Non-Kitchen Appliance > NOT BOTH at the same timeC AND D = FALSE .... The Garage Door AND the Vacuum Cleaner are none of them, at the same time, Kitchen Appliances Logical F AND F = F = False AND False = FALSE0 AND 0 = 0 (FALSE)F AND T = F = False AND True = FALSE0 AND 1 = 0 (FALSE)T AND F = F = True AND False = FALSE1 AND 0 = 0 (FALSE)T AND T = T = True AND True = TRUE1 AND 1 = 1 (TRUE) ------------- 2 Quote Link to post Share on other sites
Legend 181 Posted November 2, 2012 Report Share Posted November 2, 2012 Nice... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.