Jump to content

Difference between = and ==


Recommended Posts

I thought it would be interesting to post an example. No error is thrown in here, and therefore this represents a big hole in my argument. Using 1/0 may still be a valid method if the circumstances allow.

Dim $v = 1
MsgBox(0, "", Func1(Func2(Func3($v))))

Func Func3($v)
    Return $v/0
EndFunc

Func Func2($v)
    Return StringLen($v)
EndFunc

Func Func1($v)
    Return $v -6
EndFunc

MvGulik you are right. I didn't intend to vere so far away from the topic. I was responding to something someone said earlier on.

To add to bogQ's comment below: only nest functions that you can guarantee won't fail; unless (of course) you can impliment a proceedure that will somehow handle the failure.

Edited by czardas
Link to comment
Share on other sites

its your job (your as in figurative speech not pointing at you ;) ) as a coder (programer - scripter or wot ever) not to let anythig slip pass you, to check for errors before reading return values. and not just to wite func in func all the time expecting that youl not have a single error.

Edit: and to add to czards comment on my comment:

do you read ini file and do stringsplit with no checking if iniread returned something and stringsplit variable returned array?

so error checking with nested functions can become problematic

as you tolded *only nest functions that you can guarantee won't fail* so don't nest them if you know that they can fail and then youl not have problems of checking for errors and trying to pass error to top func, if your code is properly sorted out. Nesting and expecting to find nested error (if you ask me) is dumb for putting in main program code. 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

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