On the subject of incorrect documentation:
As taken from http://www.ftgsoftware.com/manuals/basic32.pdf.
Syntax Split(Str, [Sep], [Max])
Description Return a string array containing substrings from the original string.
Str Extract substrings from this string value.
Sep Look for this string value to separate the substrings. (Default: " ")
Max Create at most this many substrings. (Default -1, which means create as many as are found.)
See Also Join( ).
Example Sub Main
Debug.Print Split("1 2 3")(1) '"2"
This does not function in ER/Studio Macro Editor. This is the following excerpt:
Debug.Print Split("xx", yy", ",")(1)
This causes the error: Expecting an existing scalar var.
This is a major drag 'cause I need this function right now. I'll write one.
In checking the SAX documentation that comes with ER/Studio, I see its not present in the documentation, nor is the Join function, but the Array function is present. Note that the Array function cannot be used as a argument, which is not expected behavior for a function.
To fill in the function, I'll grab the code from http://www.freevbcode.com/ShowCode.asp?ID=275. I suppose I could have written it, but that would be an annoying waste of time. It does need adjustment to fit the SAX ER/Studio hybrid, though.
The signature from freevbcode is:
Public Function Split(ByVal Sin As String, sOut() As String, _
Optional sDelim As String, Optional nLimit As Long = -1, _
Optional bCompare As VbCompareMethod = vbBinaryCompare) As _
To fit in line with SAX documentation, the output is not a passed value but instead a return value. I'm not sure SAX takes things as ByRef. We'll try it, though I like it as a return value better.
Conversion error #1: InStr function in SAX does not take vbCompareMethod as an argument. This is another difference between VB5 and ER/Studio SAX Basic.