home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>Right Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03120307"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css"> p.P1{ } span.T1{ font-weight:bold;} </style></head><body> <help:to-be-embedded Eid="right" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:link Id="66594">Right Function [Runtime]</help:link></p> <p class="Paragraph">Returns the rightmost "n" characters of a string expression.</p> </help:to-be-embedded> <p class="Paragraph">See also: <help:link Id="66381" Eid="left" xmlns:help="http://openoffice.org/2000/help">Left Function</help:link>.</p> <p class="Paragraph"><span class="T1">Syntax</span>:</p> <p class="Paragraph">Right (Text As String, n As Integer) <help:key-word value="Right" tag="kw66594_1" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><span class="T1">Return value</span>:</p> <p class="Paragraph">String</p> <p class="Paragraph"><span class="T1">Parameter</span>:</p> <p class="Paragraph">Text: Any string expression from which to return the rightmost characters.</p> <p class="Paragraph">n: Integer expression that defines the number of characters to be returned. If <span class="T1">n</span> = 0 a zero-length string is returned.</p> <p class="Paragraph">The following example converts the given date in the format (YYYY-MM-DD) to the US date format (MM/DD/YYYY).</p> <p class="Paragraph"><span class="T1">Example:</span></p> <p class="PropText">Sub ExampleUSDate</p> <p class="PropText">Dim sInput As String</p> <p class="PropText">Dim sUS_date As String</p> <p class="PropText">sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'")</p> <p class="PropText">sUS_date = Mid(sInput, 6, 2)</p> <p class="PropText">sUS_date = sUS_date & "/"</p> <p class="PropText">sUS_date = sUS_date & Right(sInput, 2)</p> <p class="PropText">sUS_date = sUS_date & "/"</p> <p class="PropText">sUS_date = sUS_date & Left(sInput, 4)</p> <p class="PropText">MsgBox sUS_date</p> <p class="PropText">End Sub</p> </body></html>