LordPorker 7 Posted June 12, 2016 Report Share Posted June 12, 2016 I have two variables: Minimum price & Maximum price. Whether these two vars have a value (ie a price) effects the rest of the bot. What's the best way to check if both vars have a value attached? (ie true or false). thanks. Quote Link to post Share on other sites
Brutal 164 Posted June 12, 2016 Report Share Posted June 12, 2016 ifvar1 = $nothingthen = do actionelse = do other action 1 Quote Link to post Share on other sites
abbas786 78 Posted June 12, 2016 Report Share Posted June 12, 2016 Try this one if($comparison(#MinimumPrice,"!= Does not equal",$nothing) AND $comparison(#MaximumPrice,"!= Does not equal",$nothing)) { then { } else { } } 1 Quote Link to post Share on other sites
LordPorker 7 Posted June 14, 2016 Author Report Share Posted June 14, 2016 Thank you both, that works great, but I'm going to add a spanner into the works. With the minimum and maximum price input, the user is able to make the bot chose one of four possible paths: 1) No price input for either min/max 2) Only a price for min 3) Only a price for max 4) Both prices for min/max How would you check for all possible scenarios? Quote Link to post Share on other sites
LordPorker 7 Posted June 14, 2016 Author Report Share Posted June 14, 2016 ***Update*** Ok, I've added the two vars min/max price together like: comment("Check for min / max prices") if($add(#ebay_minimum_price,#ebay_maximum_price) = $nothing) { then { alert("nothing") } else { alert("price inc") } } The above will at least check if there is a min/max price value. Quote Link to post Share on other sites
abbas786 78 Posted June 15, 2016 Report Share Posted June 15, 2016 Thank you both, that works great, but I'm going to add a spanner into the works. With the minimum and maximum price input, the user is able to make the bot chose one of four possible paths: 1) No price input for either min/max 2) Only a price for min 3) Only a price for max 4) Both prices for min/max How would you check for all possible scenarios? Try this one set(#MinimumPrice,$nothing,"Global") set(#MaximumPrice,1,"Global") if($comparison(#MinimumPrice,"!= Does not equal",$nothing) AND $comparison(#MaximumPrice,"!= Does not equal",$nothing)) { then { alert("Minimum and Maximum Price != nothing") } else if($comparison(#MinimumPrice,"= Equals",$noting()) AND $comparison(#MaximumPrice,"= Equals",$nothing)) { alert("Minimum and Maximum Price = nothing") } else if($comparison(#MinimumPrice,"!= Does not equal",$nothing)) { alert("Minimum Price != nothing") } else if($comparison(#MaximumPrice,"!= Does not equal",$nothing)) { alert("Maximum Price != nothing") } else { } } 1 Quote Link to post Share on other sites
roxannegrodriguez 0 Posted June 16, 2016 Report Share Posted June 16, 2016 it was really useful post. 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.