Well I practiced making a generalized Function Pad$ because of this thread but not very useful towards specific problem of OP but WTH?
Code: (Select All)
_Title "Test Pad$" ' b+ 2022-11-02
Print "When fill space > string"
s$ = "Test Pad"
Print "*" + Pad$(" ", 20, s$, "l") + "*"
Print "*" + Pad$(" ", 20, s$, "c") + "*"
Print "*" + Pad$(" ", 20, s$, "r") + "*"
Print
Print: Print "When fill space < string"
Print "*" + Pad$(" ", 6, s$, "l") + "*"
Print "*" + Pad$(" ", 6, s$, "c") + "*"
Print "*" + Pad$(" ", 6, s$, "r") + "*"
Print: Print "When fill space = string"
Print "*" + Pad$(" ", 8, s$, "l") + "*"
Print "*" + Pad$(" ", 8, s$, "c") + "*"
Print "*" + Pad$(" ", 8, s$, "r") + "*"
Print: Print "zzz... press key to test Time$ format"
Sleep
' time format
While m < 60 And _KeyDown(27) = 0
Cls
Locate 2, 1: Print Pad$("_", 80, "Press escape to quit time format demo", "C")
s = s + 1
If s > 59 Then m = m + 1: s = 0
If m > 59 Then h = h + 1: m = 0
H$ = _Trim$(Str$(h)): M$ = _Trim$(Str$(m)): s$ = _Trim$(Str$(s))
Print Pad$("0", 2, H$, "r") + ":"; Pad$("0", 2, M$, "r") + ":" + Pad$("0", 2, s$, "r")
_Limit 1000
Wend
Locate 20, 1: Print Pad$(".", 80, "End of Pad$ Demo", "C")
Function Pad$ (FillChar$, nFill As Long, s$, Align$) ' fill char, width of whole string, string to align, align: L, C, R
Dim blank$
blank$ = String$(nFill, FillChar$)
Select Case UCase$(Align$)
Case "L": Mid$(blank$, 1) = s$
Case "C": Mid$(blank$, (nFill - Len(s$)) \ 2 + 1) = s$
Case "R"
If nFill >= Len(s$) Then
Mid$(blank$, nFill - Len(s$) + 1) = s$
Else
blank$ = Mid$(s$, Len(s$) - nFill + 1, nFill)
End If
End Select
Pad$ = blank$
End Function
b = b + ...