Sign in to follow this  
Followers 0
Jochem

AND operator is not working

4 posts in this topic

#1 ·  Posted (edited)

$close = ProcessWaitClose($process1, 1000) And ProcessWaitClose($process2, 1000) And ProcessWaitClose($process3, 1000)
            If $close = 1 Then
                $log = FileOpen($logpath & $logpathprog1 & $comptername & ".log", 1)
                FileWriteLine($log, "closed: " & @MDAY & "-" & @MON & " " & @HOUR & ":" & @MIN)
                FileClose($log)

The AND operator is not working like this but is working more like OR. But I want just to write a log file if all the processes are close and not just one of them.

Edited by Jochem

Share this post


Link to post
Share on other sites



$close = ProcessWaitClose($process1, 1000) And ProcessWaitClose($process2, 1000) And ProcessWaitClose($process3, 1000)
            If $close = 1 Then
                $log = FileOpen($logpath & $logpathprog1 & $comptername & ".log", 1)
                FileWriteLine($log, "closed: " & @MDAY & "-" & @MON & " " & @HOUR & ":" & @MIN)
                FileClose($log)

The AND operator is not working like this but is working more like OR. But I want just to write a log file if all the processes are close and not just one of them.

Is this working as you expect it to (try changing parameters):

$a = 1
$b = 1
$c = 0

$close = $a And $b And $c

If $close Then
    ConsoleWrite(@MDAY & "-" & @MON & " " & @HOUR & ":" & @MIN & @CRLF)
Else
    ConsoleWrite("! At least one is false." & @CRLF)
EndIf

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

$iPID_1 = Run ("notepad.exe")
$iPID_2 = Run ("notepad.exe")
$iPID_3 = Run ("notepad.exe")

If (ProcessWaitClose ($iPID_1, 0)) AND (ProcessWaitClose ($iPID_2, 1000)) AND (ProcessWaitClose ($iPID_3, 1000)) Then
    MsgBox (0, "", "All Closed")
EndIf

Cheers,

Brett

Share this post


Link to post
Share on other sites

thanks a lot,

this works greatly except if i implant it in my script, so I am making elsewhere an fault or wrong looping

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