[Gambas-user] Problem with finished Shell Process.State <> Process.Stopped

T Lee Davidson t.lee.davidson at gmail.com
Mon Feb 27 03:44:08 CET 2023

On 2/26/23 19:01, Jussi Lahtinen wrote:
> There is a bug in your code, this line makes no sense: "If pYtDlp And If pYtDlp.Running Then"
> Process.Running is constant with integer value 1. So, it is logically always true.
> Jussi

You are right, Jussi. I changed that line to:
If pYtDlp And If pYtDlp.State = Process.Running Then
and it works as it should.

I'll blame my glasses for that one.

@BruceS, yes, one should be careful with compound conditionals when testing objects. That's why I used the short-circuit "And 
If" as opposed to simply "And".


More information about the User mailing list