Why is it plural? Is it implying that I have a whole lot of nothing?
Q: exists it of nothing
A: False
I: singular boolean
Q: (exists it) of nothing
I: plural boolean
Why is this precedence different?
Why does the second return nothing instead of the existence of nothing?
This causes these issues which have plagued me since I started using bigfix:
Q: (if (exists item 0 of it or exists item 1 of it) then ("Say something") else ("Say something else"))
of (component strings of sids of local users whose (no password required flag of it and not account
disabled flag of it),"something")
I: plural string
Yet this works:
Q: exists item 0 of it of ((component strings of sids of local users whose (no password required flag
of it and not account disabled flag of it)),("something"))
A: False
I: singular boolean
Has anyone found a solution to this kind of thing?
When you make a singular query, 1 response is expected. If there is more or less than one, then it returns an error. So if “nothing” is returned for a “singular entry”, then it returns the error “Singular expression refers to non-existent object” (i.e., you were expecting something and got nothing).
When you make a plural query, then any number of responses may come up (including 0 or “nothing”)
Simple example:
q: files "C:\DoesNotExist"
I: plural file
q: file "C:\DoesNotExist"
E: Singular expression refers to nonexistent object.
Adding “exists” to the first part of any expression will convert it to a “singular boolean”, such as:
q: exists files “C:\DoesNotExist”
A: False
I: singular boolean
And when you use the "(it) of " syntax, then your result will be plural if the object is plural… for instance:
q: (name of it) of files of folder "C:"
A: hiberfil.sys
A: ntuser.dat.LOG2
A: ntuser.dat{9ec79f32-95a0-11df-866a-78dd08b5e6c8}.TM.blf
I: plural string
In your nothing example the inspector “nothing” is actually special-cased to always be “plural”, which should explain your result…
So in the first part your second example:
You are basically saying "(if blah blah of it) of " so the result is plural… and if nothing is returned, then it is considered to be a 0-result answer.
And in the second part your second example:
You are basically saying “exists ()” which returns false if 0 results are returned.
I think I know the answer to this, but is there an easy way to handle something like this:
Q: (if (exists item 0 of it or exists item 1 of it) then (“Say something”) else (“Say something else”)) of (component strings of sids of local users whose (no password required flag of it and not account disabled flag of it),“something”)
I: plural string
without doing something like:
Q: (if (exists component strings of sids of local users whose (no password required flag of it and not account disabled flag of it) or exists “something”) then (“Say something”) else (“Say something else”)) of (component strings of sids of local users whose (no password required flag of it and not account disabled flag of it),“something”)
A: Say something
I: plural string
The latter method gets ugly when I am doing long queries with lots of clauses.