IBM Endpoint Manager, Version 9.2

Incompatible types

Q: 3; "three"
E: Incompatible types.

Some operations have multiple arguments that must be the same type, or at least share a base type. This example uses the plural (;) operator, which requires a list of objects with the same type. This same example works fine, however, with a tuple operator (,):

Q: 3, "three"
A: 3, three

Another example is with an if/then/else statement. This returns either the expression after then or else, but both must return the same object type. For instance:

Q: if exists regapp "Besconsole.exe" then version of regapp "Besconsole.exe" else 
"Not Installed"
E: Incompatible types.

The error is generated because the then expression returns a version, while the else expression returns a string. Make sure that both statements return the same type by converting the version to a string:

If exists regapp "Besconsole.exe" then version of regapp "Besconsole.exe" as string 
else "Not Installed"


Feedback