? "KiX Version: " + @KIX
? @CRLF + ":" + JustifyText("mystring", 12, "left", " ") + ":"
Function JustifyText($String, $StrLength, Optional $Justification, Optional $Delim)
;This function either centres, right or left justifies given text...default is left justification
;When debugging, please un-comment the following line...
;? "String: '" + $String + "'"
If $Delim = ""
$Delim = " "
Else
$Delim = Left($Delim, 1)
EndIf
If Len($String) < $StrLength
Select
Case $Justification = "right"
$JustifyText = JustifyText($Delim + $String, $StrLength, $Justification, $Delim)
Case $Justification = "centre"
$JustifyText = JustifyText($String, $StrLength - (($StrLength - Len($String)) / 2), "right", $Delim)
$JustifyText = JustifyText($JustifyText, $StrLength, "left", $Delim)
Case 1
$JustifyText = JustifyText($String + $Delim, $StrLength, $Justification, $Delim)
EndSelect
Else
$JustifyText = $String
EndIf
EndFunction