''
'' FF_REPEAT
'' Return a string consisting of multiple copies of the specified string.
''
'' This function is very similar to STRING$ (which makes multiple copies
'' of a single character).
''
Function FF_Repeat( ByRef nCount As Integer, _
ByRef sMainString As String _
) As String
If nCount <= 0 Then Return ""
' Create the final full buffer and insert the
' strings into it in order to avoid nCount concatenations.
Dim nLen As Integer = Len(sMainString)
Dim s As String = Space(nCount * nLen)
Dim i As Integer = 1
For i = 0 To nCount - 1
Mid(s,(i*nLen)+1,nLen) = sMainString
Next
Return s
End Function