Summary: | Unclear documentation of InStr "Compare" parameter | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Jim Avera <jim.avera> |
Component: | Documentation | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | ||
Severity: | normal | CC: | himajin100000, olivier.hallot |
Priority: | medium | ||
Version: | 7.0.0.0.alpha0+ | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Crash report or crash signature: | Regression By: |
Description
Jim Avera
2019-12-16 21:05:01 UTC
Typo, meant "unless the parameter is passed by reference" While fixing this, there are a couple of other improvements which could be made: * Mention whether the first position of a string is 1 or 0. * Show the result from the code example (currently it just lists the code without saying what the expected result is). In the example of the Help page on InStr, if we ommit Start and define Compare, we get an error. E.g. iPos = Instr(sInput,"c",0) Thus I think the word "return" is misleading and should be removed. (In reply to Jim Avera from comment #2) > While fixing this, there are a couple of other improvements which could be > made: > > * Mention whether the first position of a string is 1 or 0. Wrong. For the same example, iPos = Instr(4,"Office","f",0) the result is 0 because the search starts at position 4 and 'f' occurs at 2 and 3. IOW, it will search 'f' in string 'ice'. > > * Show the result from the code example (currently it just lists the code > without saying what the expected result is). Agree. correction, string "ce". |