' split String ' Last updated: <2024/02/16 03:32:37 +0900> ' ' Passing Arrays to Procedures - FreeBASIC Wiki Manual | FBWiki ' https://www.freebasic.net/wiki/ProPgPassingArrays ' https://makoto-watanabe.main.jp/freebasic/ProPgPassingArrays.html #ifndef __SPLITSTRINGB__ #define __SPLITSTRINGB__ Sub splitStringB(ByVal src As String, ByVal delim As String, result(Any) As String) Do Dim As Integer i = InStr(1, src, Chr(delim[0])) ' search delimiter ReDim Preserve result(UBound(result) + 1) If i = 0 Then ' not found delimiter. exit loop result(UBound(result)) = src Exit Do End If result(UBound(result)) = Left(src, i - 1) ' save word to array src = Mid(src, i + 1) ' delete word Loop End Sub #endif