[Libreoffice-bugs] [Bug 122352] New: Mid statement ignores length parameter

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Dec 28 01:04:43 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=122352

            Bug ID: 122352
           Summary: Mid statement ignores length parameter
           Product: LibreOffice
           Version: 6.1.3.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: benbignoise at gmx.de

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20181228/b579545a/attachment-0001.html>


More information about the Libreoffice-bugs mailing list