VB6 isIn function
Date: 02.27.18 - 10:09pm
So I have been coding up a bunch of these variant helper functions that operate generically on a bunch of different variable types for my dzrt library.
Here is an isIn function that allows you to search strings, arrays, and collections for the needle you are looking for. It can optionally return the index of that item in an out variable. For strings index is string position. For arrays and collections it is the element index.
collections also support object arguments. I think this will be handy alternative to having to search arrays and collections manually everytime.
I will add this to my globals.cls which is a set of functions automatically added to the global namespace and accessible as a new language function as soon as you add a reference to the dzrt dll.
Another example of this type of function is a readfile function which can load a file into either a byte array or string based on the variable type you pass it. MD5 functions which can automatically work on files, strings and byte arrays etc. Handy shortcuts all and really making the most of the vb variant datatype.