In C# I can do this:
public string[] MyStrings;
...
...
if(MyStrings.Contains("bob")) ...
In ObjectScript how is this done?
With %ArrayOfObjects type I don’t see exactly what I am looking for here
What I have tried:
#Dim MyStrings As %ArrayOfDataTypes
do MyStrings.SetAt("User","User")
do MyStrings.SetAt("Users","Users")
do MyStrings.SetAt("Group","Group")
do MyStrings.SetAt("Groups","Groups")
// if MyStrings contains Groups
if MyStrings.GetAt("Groups") '= ""
{
}
You’ve got it right. I would suggest making a subclass of %Library.ArrayOfDataTypes with your own methods on it, such as “contains”.
It’s probably a little safer to use your own classes that you do control than library classes that you don’t anyway (though in a pinch you could always use %Dictionary package methods to switch all references to a library class to a new class of your design, so it’s not really that big a deal).