FF_LSET

Started by Paul Squires, August 19, 2015, 01:42:24 PM

Previous topic - Next topic

Paul Squires




''
''  FF_LSET
''  Return a string containing a left-justified (padded) string.
''
''  If sPadCharacter is null (empty) or is not specified, then the function
''  pads string_expression with space characters to the right. Otherwise,
''  the function pads the string with the first character of sPadCharacter.
''
Function FF_LSet( 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, 1, Len(sMainString) ) = sMainString
   
    Function = s
End Function

Paul Squires
PlanetSquires Software