Sign in to follow this  
Followers 0
kylomas

Seterror Help

4 posts in this topic

Can anyone explain this instruction:

If @error Then Return SetError(1,0,0*TCPShutdown())

I don't understand the "return value" parameter.

Thanks,

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

That is an example of code condensing. It's a shorter way of writing this and produces the same results.

Close but should be:

If @error Then
    $rc = TCPShutdown()
    Return SetError(1,0,$rc)
EndIf

:)

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

No, Jos, the return value of TCPShutdown() is being multiplied by 0, so the return parameter will always be zero.

True ... :)

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Thank you, gentlemen.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
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
Sign in to follow this  
Followers 0