Checking for Character Key Sets part 3

We’ve already seen two ways to get at the IsCharacterKeySet parameter: 1) using the GetValue command, and 2) using XSICollection.Items.

Now, here’s a third way, using Dictionary.GetObject(). Dictionary.GetObject takes a string name and returns the corresponding object:

var oProp = Selection(0);
var oParam = Dictionary.GetObject( oProp + ".IsCharacterKeySet" );
LogMessage( oParam.Value );

So what’s the best way to get IsCharacterKeySet? One thing to consider is that GetValue and Dictionary.GetObject both fail if the string does not resolve to an object. XSICollection.Items, on the other hand, won’t fail; you just have to check the .Count property after to see whether you got the parameter.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s