Question

I have looked at the documentation for UniObjects for Java and VB and do not see a way to search a UniDynArray without resorting to a loop.

Is that the intention you think to rely on the API language (i.e. Java)?

This is what I ended up doing in VBScript.

If InStr(daShipAlones.TextValue, sDocNum) = 0 Then 
    ....
End If
Était-ce utile?

La solution

I agree with your findings that there is no "UniObjects" way to search through a UniDynArray.

You can search without resulting to a loop (and in one line) by converting the UniDynArray to a string array and then using the language's IndexOf equivalent to retrieve the location of you search term. In C#/VB this can be done like so:

Array.IndexOf(myUniDynArray.StringValue.Split(UniConstants.FieldMarker), "searchterm")

Where UniConstants.FieldMarker is essentially an alias for (char)254

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top