Returning a Dictionary

@sgils - Unfortunately no, and I have wished for the same functionality in the past. The reason is because in VENUS, dictionary functionality is ultimately a Microsoft scripting object exposed through HSL, and not functionally native to HSL. That is more or less where HSLExtensions gets it’s name, as many of it’s libraries extend the functionality of VENUS by tapping into various Windows features not natively supported by HSL. Because Windows has no idea what a sequence is, they are not a supported item type for dictionaries.

I believe the supported items are variant types integer, float and string.

That being said, you can circumvent these limitations with additional programming if desired. Delimited strings can contain all sorts of nested data schemas (i.e. store sequence data), and still consist of a single string variable. I would suggest checking out this post where much of this is discussed in greater detail.

The base data structure of sequences are composed of individual strings (labware ID and position ID). Using the HSLSeqLib (default) and the String library of HSL extensions, you could write brief helper functions that would parse and store a sequence as a string, which could then be stored in the dictionary. Another helper function would convert the formatted string back into a sequence usable by VENUS. I have totally used this technique in the past.

Similar techniques can be used to store arrays as a delimited string in a dictionary. This is also discussed in the linked post.

-Nick

3 Likes