DECLARE FUNCTION MyArrayGJoin$ (SeparatorI AS STRING)

   REDIM SHARED MyArrayG$(0)

   REDIM MyArrayG$(0)
   MyArrayG$(0) = "~Empty~"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

   REDIM MyArrayG$(0)
   MyArrayG$(0) = "000"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

   REDIM MyArrayG$(1)
   MyArrayG$(0) = "000"
   MyArrayG$(1) = "111"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

   REDIM MyArrayG$(2)
   MyArrayG$(0) = "000"
   MyArrayG$(1) = "111"
   MyArrayG$(2) = "222"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

   REDIM MyArrayG$(1)
   MyArrayG$(0) = "000"
   MyArrayG$(1) = "111"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

   REDIM MyArrayG$(0)
   MyArrayG$(0) = "000"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

   REDIM MyArrayG$(0)
   MyArrayG$(0) = "~Empty~"
   PRINT MyArrayGJoin$(";"); "<== "; LBOUND(MyArrayG$); ".."; UBOUND(MyArrayG$)

FUNCTION MyArrayGJoin$ (SeparatorI AS STRING)
   DIM ResultL AS STRING
   DIM iL AS INTEGER

   IF UBOUND(MyArrayG$) = 0 THEN
      IF MyArrayG$(0) = "~Empty~" THEN
         MyArrayGJoin$ = ""
         EXIT FUNCTION
      END IF
   END IF

   ResultL = ""

   '----- LOOP , Concat items
   FOR iL = 0 TO UBOUND(MyArrayG$)
      IF iL > 0 THEN ResultL = ResultL + SeparatorI
      ResultL = ResultL + MyArrayG$(iL)
   NEXT

   MyArrayGJoin$ = ResultL
END FUNCTION
