Count vs length vs size

A pedantic nit..... :slight_smile:

The VECTOR object supports both length and size as synonyms for count and all three properties are documented in the help file.
The RESULTS object only supports count and it is not documented in the help file.

Regards, AB

What are you expecting Results.count to do?

objCmd.results.newlisters.count indicates whether a new lister was created by the most recent command.
objCmd.results.newtabs.count indicates whether any new tabs were created by the most recent command.

I am testing the result of a Go command which could have specified NEW or NEWTAB. NEW will generate a newlisters.count of 1 and if both newlisters.count and newtabs.count are zero then the Go command "failed" in the context of my use case.

Regards, AB

Ah OK, that is not the results object but two collection objects which are members of the results object.

Collections are an ActiveScripting feature and use "count". (Actually, it may be up to the scripting language what the property is called; I am not sure.) Not all collections originate from Opus; lots of other things return them as well, such as Microsoft's various scripting objects. We can't add size and length to those.

If you want something that is consistent across collections as well as Opus's own Vector and Map objects, use count everywhere and pretend size and length do not exist.

[quote="leo"]Ah OK, that is not the results object but two collection objects which are members of the results object.

Collections are an ActiveScripting feature and use "count". (Actually, it may be up to the scripting language what the property is called; I am not sure.) Not all collections originate from Opus; lots of other things return them as well, such as Microsoft's various scripting objects. We can't add size and length to those.

If you want something that is consistent across collections as well as Opus's own Vector and Map objects, use count everywhere and pretend size and length do not exist.[/quote]
Fair enough and thanks for the explanation.

Regards, AB