MuffettsMan

Variable is not or <> comparison failing....

4 posts in this topic

$sftpStatus = 'FAILED'
If $sftpStatus <> 'FAILED' Then
   $sftpStatus = 'SUCCESS'
EndIf
ConsoleWrite($sftpStatus & @CRLF)


$sftpStatus = 'FAILED'
If Not($sftpStatus = 'FAILED') Then
   $sftpStatus = 'SUCCESS'
EndIf
ConsoleWrite($sftpStatus & @CRLF)

Outputs:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\tmp\test.au3"   
FAILED
FAILED
>Exit code: 0    Time: 0.047

trying to toggle the variable but can't seem to find a valid workaround for !=... assuming I'm having an id10t error

 


Don't let that status fool you, I am no advanced memeber!

Share this post


Link to post
Share on other sites



I don't understand the question. You're setting the  variable to failed, then checking if it's not failed, set to success... Since it is failed, it's not going to set to success, and will return failed. This is the expected output. Are you trying to set to success if it's something other than failed? Then you should set the variable to something else.... Which with your code It would seem that it would set as success 

Share this post


Link to post
Share on other sites

rotflmao yes its doing what I said not what I meant >_< omg... so if I set it = '' then it correctly changes the value..... its a sign I need to stop now and enjoy the weekend!!


Don't let that status fool you, I am no advanced memeber!

Share this post


Link to post
Share on other sites

rotflmao yes its doing what I said not what I meant >_< omg... so if I set it = '' then it correctly changes the value..... its a sign I need to stop now and enjoy the weekend!!

The trouble with computers, they do exactly what we tell them!  time for a drink indeed! :)

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