Is there an other way like this:
dim $myStringBuff=StringBuff(3)
MsgBox(0, "StringBuff(5)=", $myStringBuff)
;-------------------------------------------------
Func StringBuff( $size, $FillChar="0")
Local $StringBuffer
For $i = 1 To $size
$StringBuffer = $StringBuffer & $FillChar
Next
Return $StringBuffer
EndFunc
to easily create a String in Autoit?
Especially
$StringBuffer = $StringBuffer & $FillChar
is a really bad way to do so regarding the performance.
(each time in the Loop a new string is created and the old one is discarded)
Maybe something like this
Local $StringBuffer[$size]
For $i = 1 To $size
$StringBuffer[$i] = $FillChar
Next
Return $StringBuffer
^-Sample Doesn't work
...or
Local $StringBuffer
For $i = 1 To $size
_StringAppend($StringBuffer, $FillChar)
Next
Return $StringBuffer
were '_StringAppend()' is some Interpreter optimised version that does some kind of redim to $StringBuffer and then append $FillChar