PlanetSquires Forums

Support Forums => General Board => Topic started by: Paul Squires on August 19, 2015, 01:43:23 PM

Title: FF_CSET
Post by: Paul Squires on August 19, 2015, 01:43:23 PM



''
''  FF_CSET
''  Return a string containing a centered (padded) string.
''
''  If sPadCharacter is null (empty) or is not specified, then the function
''  pads string_expression with space characters to the left and right.
''  Otherwise, the function pads the string with the first character of sPadCharacter.
''
Function FF_CSet( ByRef sMainString   As String, _
                  ByRef nStringLength As Integer, _
                  ByRef sPadCharacter As String = " " _
                  ) As String

    Dim s As String
    s = String( nStringLength, Asc(sPadCharacter, 1) )
   
    Mid( s, (nStringLength-Len(sMainString))/2+1, Len(sMainString) ) = sMainString

    Function = s
End Function