Jump to content

Difference between = and ==


Recommended Posts

well, basically this is the code (as shown above)

_IETagNameGetCollection($oROFL, "TD")
For $x = 0 To @extended - 1
$oQuery = _IETagNameGetCollection($oROFL, "TD", $x)
If _IEPropertyGet($oQuery, "outertext") = "Controle & Oplevering " Then
  MsgBox(1, "", "")
  $oQuery.click
  ExitLoop
EndIf
Next
_IELoadWait($oROFL)

This code shows the messagebox but does not execute the $oQuery.click.

if we replace the "=" with "==" in the if statement, it DOES execute $oQuery.click and it clicks the (java)link.

THAT behaviour.

Link to comment
Share on other sites

perhaps there are two instances of the string. One with exact case spelling and one with other spelling.

Just remove the "exitloop" and look if there are more than one matching events.

I looked at that, but its the only instance, thanks anyway :)

Link to comment
Share on other sites

well, basically this is the code (as shown above)

_IETagNameGetCollection($oROFL, "TD")
For $x = 0 To @extended - 1
$oQuery = _IETagNameGetCollection($oROFL, "TD", $x)
If _IEPropertyGet($oQuery, "outertext") = "Controle & Oplevering " Then
MsgBox(1, "", "")
$oQuery.click
ExitLoop
EndIf
Next
_IELoadWait($oROFL)

This code shows the messagebox but does not execute the $oQuery.click.

if we replace the "=" with "==" in the if statement, it DOES execute $oQuery.click and it clicks the (java)link.

THAT behaviour.

This will probably hurt you but are you stupid person? You are no using your head. You can't see the forest for the trees.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

This will probably hurt you but are you stupid person? You are no using your head. You can't see the forest for the trees.

Look we might not be as experienced nor advanced in coding as you are, but this problem is occurring. Why would my colleague or I lie about this? And why the aggressive flaming?

I'm not saying its AutoIts fault, nor am I blaming anything. Im just trying to figuring out what is going on...

Link to comment
Share on other sites

I already have. You just need time to comprehend.

You didn't, you said that using methods without braces it might fail... but that does not explain why the "=" doesn't work and the "==" does.

Everywhere else in the whole code, $bla.click works without braces, only in this part it does not work... and you call me stupid :)

Link to comment
Share on other sites

he is saying that op need to post code that others can test, and not some cut out things that we need to consult crystal ball for testing.

No code for testing = no help.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

You didn't, you said that using methods without braces it might fail... but that does not explain why the "=" doesn't work and the "==" does.

Everywhere else in the whole code, $bla.click works without braces, only in this part it does not work... and you call me stupid :)

I didn't call you stupid. I asked you if you are supid because you act like that?

Good luck learning programming.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

he is saying that op need to post code that others can test, and not some cut out things that we need to consult crystal ball for testing.

No code for testing = no help.

That i understand, but it is an internal website, all other reproductions i tried (with selfbuild HTML code, or stripped HTML code from the original website) failed. Those all work, i was just wondering why this one does not. Its very strange.

Link to comment
Share on other sites

i whud just for fun change

MsgBox(1, "", "")

to

MsgBox(1, "", '"'&_IEPropertyGet($oQuery, "outertext")&'"')

to see if result is identical on = and ==

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

I've twice started threads about the difference between the = and == operators and the need for better documentation.

The first was back in Jan 2009. I managed to get the help file expanded slightly as to the behavior of these operators (it used to mention ONLY case-sensitivity), but I still don't think the phrasing is very helpful to the majority of people.

The "converted to strings" mentioned in the helpfile results in behavioral differences between the two operators when comparing a null or empty string (""), a numeric 0, the null character (ASCII 0), and boolean True or False.

If "" = 0 Then Beep(800,100) ; true
If "" == 0 Then Beep(900,100) ; false
Sleep(100)
If "" = Chr(0) Then Beep(800,100) ; true
If "" == Chr(0) Then Beep(900,100) ; false
Sleep(100)
If "" = False Then Beep(800,100) ; true
If "" == False Then Beep(900,100) ; false
Sleep(100)
If 0 = Chr(0) Then Beep(800,100) ; true
If 0 == Chr(0) Then Beep(900,100) ; false
Sleep(100)
If 0 = False Then Beep(800,100) ; true
If 0 == False Then Beep(900,100) ; false
Edited by Spiff59
Link to comment
Share on other sites

well, basically this is the code (as shown above)

_IETagNameGetCollection($oROFL, "TD")
For $x = 0 To @extended - 1
$oQuery = _IETagNameGetCollection($oROFL, "TD", $x)
If _IEPropertyGet($oQuery, "outertext") = "Controle & Oplevering " Then
MsgBox(1, "", "")
$oQuery.click
ExitLoop
EndIf
Next
_IELoadWait($oROFL)

This code shows the messagebox but does not execute the $oQuery.click.

if we replace the "=" with "==" in the if statement, it DOES execute $oQuery.click and it clicks the (java)link.

So i know you found a way to hack-around the code to make it work... which is always bad unless you're a manager on commission...

however when you tested this, did you perform a multi-run test on both instances (20+ tests) to ensure that what you are saying is 100% accurate? It 100% of the time only works when used with "==" and 100% of the time fails when used with "=" ?

The issue here doesn't make sense that it would have to do with "==" and "=" because you're saying your msgbox() pops up every time. The issue has to lie with $oQuery.click. Since it is a method, it's supposed to be called as $oQuery.click() as Trancexx has explained, which you stated that in your entire code, you've neglected to use the braces. Although you say it does work, it's not the way it's meant to be written and should be changed throughout to avoid any future errors in both logic and implementation.

And I apologize if I missed it, but you didn't state whether or not you had appended the braces to the method to see if it creates the same issue.

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

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...