Jump to content

problem with "if"


Recommended Posts

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 by jackraymund

thanks you BrewManNH

Link to comment
Share on other sites

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 by jackraymund

thanks you BrewManNH

Link to comment
Share on other sites

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 by jackraymund

thanks you BrewManNH

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by czardas
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...