home *** CD-ROM | disk | FTP | other *** search
Wrap
<?xml version="1.0" encoding="utf-8"?> <html><head><title>UBound Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03103000"/><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="ubound" xmlns:help="http://openoffice.org/2000/help"> <p class="Head1"><help:link Id="66401">UBound Function [Runtime]</help:link></p> <p class="Paragraph">Returns the upper bound of an array.</p> </help:to-be-embedded> <p class="Paragraph"><span class="T1">Syntax</span>:</p> <p class="Paragraph">UBound (ArrayName [, Dimension]) <help:key-word value="UBound" tag="kw66401_1" xmlns:help="http://openoffice.org/2000/help"/></p> <p class="Paragraph"><span class="T1">Return value</span>:</p> <p class="Paragraph">Integer</p> <p class="Paragraph"><span class="T1">Parameter</span>:</p> <p class="Paragraph">ArrayName: Name of the array for which to determine the upper (<span class="T1">Ubound</span>) or lower (<span class="T1">LBound</span>) bound.</p> <p class="Paragraph">[Dimension] : Integer that specifies which dimension to return the upper(<span class="T1">Ubound</span>) or lower (<span class="T1">LBound</span>) boundary for. If no value is specified, the first dimension is assumed.</p> <p class="Paragraph"><span class="T1">Example:</span></p> <p class="PropText">Sub ExampleUboundLbound</p> <p class="PropText">Dim sVar(10 to 20) As String</p> <p class="PropText">print LBound(sVar())</p> <p class="PropText">print UBound(sVar())</p> <p class="PropText">end Sub</p> <p class="PropText">Sub ExampleUboundLbound2</p> <p class="PropText">Dim sVar(10 to 20,5 To 70) As String</p> <p class="PropText">Print LBound(sVar()) REM Returns 10</p> <p class="PropText">Print UBound(sVar()) REM Returns 20</p> <p class="PropText">Print LBound(sVar(),2) REM Returns 5</p> <p class="PropText">Print UBound(sVar(),2) REM Returns 70</p> <p class="PropText">end Sub</p> </body></html>