summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/sbasic/shared/partition.xhp
blob: 0f72b05cc8a8cecaf885d4b94d3aa86bbe90f20d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
    <!--
    * This file is part of the LibreOffice project.
    *
    * This Source Code Form is subject to the terms of the Mozilla Public
    * License, v. 2.0. If a copy of the MPL was not distributed with this
    * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    *
    -->

    <meta>
        <topic id="vbapartition" indexer="include" status="PUBLISH">
            <title id="tit" xml-lang="en-US">Partition Function</title>
            <filename>/text/sbasic/shared/partition.xhp</filename>
        </topic>
    </meta>
    <body>
    <section id="vbapartition">
        <bookmark xml-lang="en-US" branch="index" id="bm_id31548421805896">
            <bookmark_value>Partition Function</bookmark_value>
        </bookmark>
        <h1 id="hd_id171548419512929"><link href="text/sbasic/shared/partition.xhp">Partition Function [VBA]</link></h1>
        <paragraph role="paragraph" id="par_id461548419700445">Returns a string indicating where a number occurs within a calculated series of ranges.</paragraph>
    </section>
    <embed href="text/sbasic/shared/00000003.xhp#vbasupport"/>
    <embed href="text/sbasic/shared/00000003.xhp#functsyntax"/>
    <paragraph role="code" id="par_id111548419647867">Partition( Number, Start, Stop, Interval)</paragraph>
    <embed href="text/sbasic/shared/00000003.xhp#functvalue"/>
    <paragraph role="paragraph" localize="false" id="par_id971548420129767">String</paragraph>

    <embed href="text/sbasic/shared/00000003.xhp#functparameters"/>
    <paragraph role="paragraph" id="par_id481548420000538"><emph>Number</emph>: Required. The number to determine the partition.</paragraph>
    <paragraph role="paragraph" id="par_id841548420006137"><emph>Start</emph>: Required. An integer number defining the lower value of the range of numbers.</paragraph>
    <paragraph role="paragraph" id="par_id781548420012105"><emph>Stop</emph>: Required. An integer number defining the highest value of the range.</paragraph>
    <paragraph role="paragraph" id="par_id371548420017250"><emph>Interval</emph>: Required. An integer number that specifies the size of the partitions within the range of numbers (between <literal>Start</literal> and <literal>Stop</literal>).</paragraph>

    <embed href="text/sbasic/shared/00000003.xhp#functexample"/>
    <bascode>
        <paragraph role="bascode" id="par_id321548420503855" localize="false">Option VBASupport 1</paragraph>
        <paragraph role="bascode" id="par_id431548420514604" localize="false">Option Explicit</paragraph>
        <paragraph role="bascode" id="par_id181548420522842" localize="false">Sub Test_Partition</paragraph>
        <paragraph role="bascode" id="par_id721548420527861" localize="false">    Dim retStr As String</paragraph>
        <paragraph role="bascode" id="par_id21548420534821" localize="false">    retStr = Partition(20, 0, 98, 5)</paragraph>
        <paragraph role="bascode" id="par_id561548420541509" xml-lang="en-US">    print "20:24  the number 20 occurs in the range: " &amp; retStr</paragraph>
        <paragraph role="bascode" id="par_id261548420553088" localize="false">    retStr = Partition(20, 0, 99, 1)</paragraph>
        <paragraph role="bascode" id="par_id161548420558523" xml-lang="en-US">    print " 20: 20 the number 20 occurs in the range: " &amp; retStr</paragraph>
        <paragraph role="bascode" id="par_id251548420573894" localize="false">    retStr = Partition(120, 0, 99, 5)</paragraph>
        <paragraph role="bascode" id="par_id561548420579525" xml-lang="en-US">    print  "100:  the number 120 occurs in the range: " &amp; retStr</paragraph>
        <paragraph role="bascode" id="par_id611548420591014" localize="false">    retStr = Partition(-5, 0, 99, 5)</paragraph>
        <paragraph role="bascode" id="par_id921548420596118" xml-lang="en-US">    print "   : -1 the number -5 occurs in the range: " &amp; retStr</paragraph>
        <paragraph role="bascode" id="par_id561548420604604" localize="false">    retStr = Partition(2, 0, 5, 2)</paragraph>
        <paragraph role="bascode" id="par_id861548420616153" xml-lang="en-US" >    print " 2: 3 the number 2 occurs in the range: " &amp; retStr</paragraph>
        <paragraph role="bascode" id="par_id841548421054219" localize="false">End Sub</paragraph>
    </bascode>
    <section id="relatedtopics">
        <embed href="text/sbasic/shared/00000003.xhp#VBAMath"/>
    </section>
</body>
</helpdocument>