Logic Test Fails

Why does

not exists file “C:\Program Files\Mozilla Firefox\firefox.exe” OR not exists file “C:\Program Files (x86)\Mozilla Firefox\firefox.exe”

Evaluate to TRUE when C:\Program Files (x86)\Mozilla Firefox\firefox.exe is on the hard drive. It should be FALSE because one of the referenced files is there.

Thanks

ahhh, the old double negative. gets me every time.

if X and Y both exist, you will get
not exists X or not exists Y
not true or not true = false or false = false

If only X exists
not exists X or not exists Y
not true or not false = false or true = true

If only Y exists
not exists X or not exists Y
not false or not true = true or false = true

If neither X nor Y exists
not exists X or not exists Y
not false or not false = true or true = true

How do you test for either condition?

You are probably looking for…

not (exists X or exists Y)

Q:not exists file (“C:\Program Files\Mozilla Firefox\firefox.exe” OR “C:\Program Files (x86)\Mozilla Firefox\firefox.exe”)
E: A boolean expression is required.

q: exists file "C:\Program Files\Mozilla Firefox\firefox.exe"
A: False
T: 0.722 ms
I: singular boolean

q: exists file "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
A: True
T: 0.685 ms
I: singular boolean

Q:not (exists file "C:\Program Files\Mozilla Firefox\firefox.exe" OR exists file "C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
A: False
T: 1.399 ms
I: singular boolean

Q:not exists files ("C:\Program Files\Mozilla Firefox\firefox.exe" ; "C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
A: False
T: 1.372 ms
I: singular boolean

Awesome! So, instead of OR its a ;

that last was is an advanced form… it says “try to create file objects for each of the Plural Strings inside of the parenthesis”. Since I used Files instead of File (single), it will ignore the ones that do not exist.

while learning, you should probably stick with the 3rd one there, since it is more obvious.

Q:not (exists file "C:\Program Files\Mozilla Firefox\firefox.exe" OR exists file "C:\Program Files (x86)\Mozilla Firefox\firefox.exe")
1 Like

I’ve been learning for years. I very much appreciate your help.

1 Like