RSet Function

Returns a string that has been right aligned within a fixed length.

RSet (string, length)

Parameters

String - (Input,  expression, Required)

Specifies the string to be right aligned. If a numeric expression is passed, it is first converted to string form. If anything else other than a string is passed, the result is Error. If Null is passed, the string is assumed to be empty.

Length  -  (Input, expression, Required)

Specifies the length of the return string. If a non-numeric length is passed, or if the length is negative, the result is Error

Return Value

A copy of the passed string padded out on the left side with spaces so that it is right aligned within the specified width. If the passed string is longer than the specified length, the result will contain only the truncated right-most portion of the string that fits.

Examples

RSet (123, 10)

Returns “ 123“

RSet (“ABC”, 10)

Returns “ ABC“

RSet (“ABC”, 3)

Returns “ABC”

RSet (“ABC”, 2)

Returns “BC”

RSet (“ABC”, 0)

Returns “”

RSet (“ABC”, -1)

Returns Error

RSet (Null, 10)

Returns “ “

RSet (Error, 10)

Returns Error

TIP:

Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.

See Also

Functions | Asc function | Chr function | CSet function | Format function | InStr function | LCase function | Left function | Len function | LSet function | LTrim function | Mid function | Replace function | Right function | RSet function | RTrim function | Space function | String function | TCase function | Trim function | UBound function | UCase function


© 2004-2021 looksoftware. All rights reserved.