Singular expression refers to nonexistent object
This is one of the most common error messages generated. It usually results from querying a property of an object that does not exist, or querying a non-existent property of an object. For instance:
Q: version of file "mslib.dll" of folder "c:\temp"
E: Singular expression refers to nonexistent object.
Q: character of ""
E: Singular expression refers to nonexistent object.
Singular expressions require at least one value. To avoid this error, use a plural expression, such as characters. It won't return a value, since none is available, but it won't generate an error, either.
For this particular expression, the error is generated if any of the following are true:
- The folder "c:\temp" does not exist.
- There is no file named "misspelled.dll" in the folder "c:\temp".
- The file "misspelled.dll" located in the folder "c:\temp" does not have a version.
You could craft an expression that will not return an error by using plurals:
Q: versions of files "mslib.dll" of folders "c:\temp"
However, the better idea is to check for existence first:
Q: if (version of file "mslib.dll" of folder "c:\temp") then (version of file
"mslib.dll" of folder "c:\temp" as string) else "n/a"
This error message might display also when the user has not the permission rights to access a property, for example the user has no access rights to a site containing analysis defining that property. To avoid this problem, the administrator must give users the proper access rights to the required properties.