jackraymund Posted January 9, 2013 Share Posted January 9, 2013 (edited) if "c937ce9cfc504995e08c10dfad9e76e6" <> 0 then msgbox(0,"","") but that works if not "c937ce9cfc504995e08c10dfad9e76e6" = 0 then msgbox(0,"","") its the same, but why first didnt work, and second work?... Edited January 9, 2013 by jackraymund thanks you BrewManNH Link to comment Share on other sites More sharing options...
czardas Posted January 9, 2013 Share Posted January 9, 2013 (edited) You should get a message with both because you use the boolean NOT operator on the second example. Both expressions evaluate to True. In fact both expressions say the same thing. Edited January 9, 2013 by czardas jackraymund 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
jackraymund Posted January 9, 2013 Author Share Posted January 9, 2013 (edited) but i getting message only with second, first didnt work... try it if "c937ce9cfc504995e08c10dfad9e76e6" <> 0 then consolewrite("1" & @CRLF) if not "c937ce9cfc504995e08c10dfad9e76e6" = 0 then consolewrite("2" & @CRLF) @edit if not "c937ce9cfc504995e08c10dfad9e76e6" <> 0 then consolewrite("3" & @CRLF) that return false too... 42e0ae3b87a2fcb097215f5a03565e69 d5a681de57f3a7318789a2eebc1a5157 faba1a16c0b656ba961cb7724c114353 1e2653ff6dedb66dee5035744bcffaa8 c937ce9cfc504995e08c10dfad9e76e6 c1e8dee81f5a221bd4628229d6d64160 bbb5310e3a4f7648d1a35ffe4af4eef0 dbeedb7e655e96ce496af4496d0b2a34 global $works[8] = ["42e0ae3b87a2fcb097215f5a03565e69","d5a681de57f3a7318789a2eebc1a5157","faba1a16c0b656ba961cb7724c114353","1e2653ff6dedb66dee5035744bcffaa8","c937ce9cfc504995e08c10dfad9e76e6","c1e8dee81f5a221bd4628229d6d64160","bbb5310e3a4f7648d1a35ffe4af4eef0","dbeedb7e655e96ce496af4496d0b2a34"] for $i = 0 to UBound($works) - 1 if $works[$i] <> 0 then consolewrite($works[$i] & @CRLF) Next only 2 strings works, why? Edited January 9, 2013 by jackraymund thanks you BrewManNH Link to comment Share on other sites More sharing options...
AZJIO Posted January 9, 2013 Share Posted January 9, 2013 (edited) jackraymund, read the help file section operators. strings are converted to numbers using "Number" The "Not" operator has a higher precedence than "=" Edited January 9, 2013 by AZJIO jackraymund 1 My other projects or all Link to comment Share on other sites More sharing options...
jackraymund Posted January 9, 2013 Author Share Posted January 9, 2013 (edited) ok, i solve the problem 0 is a int, not string, its realy crazy lol global $works[8] = ["42e0ae3b87a2fcb097215f5a03565e69","d5a681de57f3a7318789a2eebc1a5157","faba1a16c0b656ba961cb7724c114353","1e2653ff6dedb66dee5035744bcffaa8","c937ce9cfc504995e08c10dfad9e76e6","c1e8dee81f5a221bd4628229d6d64160","bbb5310e3a4f7648d1a35ffe4af4eef0","dbeedb7e655e96ce496af4496d0b2a34"] for $i = 0 to UBound($works) - 1 if String($works[$i]) <> string(0) then consolewrite($works[$i] & @CRLF) Next Edited January 9, 2013 by jackraymund thanks you BrewManNH Link to comment Share on other sites More sharing options...
AZJIO Posted January 9, 2013 Share Posted January 9, 2013 Global $works[8] = [ _ "42e0ae3b87a2fcb097215f5a03565e69", _ "d5a681de57f3a7318789a2eebc1a5157", _ "faba1a16c0b656ba961cb7724c114353", _ "1e2653ff6dedb66dee5035744bcffaa8", _ "c937ce9cfc504995e08c10dfad9e76e6", _ "c1e8dee81f5a221bd4628229d6d64160", _ "bbb5310e3a4f7648d1a35ffe4af4eef0", _ "dbeedb7e655e96ce496af4496d0b2a34"] For $i = 0 To UBound($works) - 1 If $works[$i] <> '0' Then ConsoleWrite($works[$i] & @CRLF) If Not ($works[$i] == 0) Then ConsoleWrite($works[$i] & @CRLF) Next jackraymund 1 My other projects or all Link to comment Share on other sites More sharing options...
czardas Posted January 9, 2013 Share Posted January 9, 2013 (edited) Okay I made a mistake. I get what's going on now. Compare the following: if not "c937ce9cfc504995e08c10dfad9e76e6" = 0 then msgbox(0,"","Without parenthesis") if not ("c937ce9cfc504995e08c10dfad9e76e6" = 0) then msgbox(0,"","With parenthesis") Edited January 9, 2013 by czardas jackraymund 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now