<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Mid statement ignores length parameter"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=122352">122352</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Mid statement ignores length parameter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.1.3.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>BASIC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>benbignoise@gmx.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
The Mid statement can be used to replace a sub-string inside a given string. 
The third parameter specifies the number of characters to be replaced. 
This parameter is ignored.

See following snippet:

Sub StringTest
        Dim MyString As String
        MyString = "This will be my text"
        Mid(MyString, 6, 7, "is")
End Sub

In the string "This will be my text", we should see that starting at the 6th
position 7 characters are replaced by "is". 


Steps to Reproduce:
Open the given snippet in the macro debugger and observe the "MyString"
variable before and after the "Mid" statement

Actual Results:
Only 2 characters instead of 7 are replaced: 
"This isll be my text"

Expected Results:
7 characters should be replaced by "is": 
"This is my text"


Reproducible: Always


User Profile Reset: Yes



Additional Info:
I cannot exactly tell which version was the first affected. 
I have observed the described problem in LO 6.1.3.2
The problem did not yet exist in LO 6.0.5.2</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>