Bug 154471 - Writer LibreLogo LIST wrong results
Summary: Writer LibreLogo LIST wrong results
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-30 10:20 UTC by Michael Plehnert
Modified: 2023-04-01 17:53 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Tests for Bug 154471 (10.49 KB, application/vnd.oasis.opendocument.text)
2023-04-01 09:23 UTC, Michael Plehnert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Plehnert 2023-03-30 10:20:40 UTC
Description:
Function LIST generates wrong results [Writer, LibreLogo, macOS]

Steps to Reproduce:
1. PRINT LIST (“Word”) → [u'W', u'o', u'r', u'd']
2. PRINT LIST (“ABC”, “DEF”) → [u'ABC', u'DEF']
but
3. PRINT LIST (1, 2, 3) → [1, 2, 3]

Actual Results:
Steps 1. an 2.: If the arguments of LIST are (one or more) strings, the result contains character u before and single quote marks around each element of the resulting list.

Expected Results:
Step 3.: If the arguments of LIST are (one or more) numbers, the result is a correct list of the numbers of the argument.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.1.2 (AARCH64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 8; OS: Mac OS X 13.3; UI render: default; VCL: osx
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded
Comment 1 eisa01 2023-03-31 16:53:57 UTC
What happens if you print the individual items in the list?

I assume the u prefix just means it's unicode format, so this is not a bug

If that is not the case, can you upload a test document and some description of how to test? I tried activating the Logo toolbar, but don't really understand how this works

https://www.w3docs.com/snippets/python/what-exactly-do-u-and-r-string-prefixes-do-and-what-are-raw-string-literals.html
Comment 2 Michael Plehnert 2023-04-01 09:23:04 UTC
Created attachment 186390 [details]
Tests for Bug 154471
Comment 3 Michael Plehnert 2023-04-01 09:25:36 UTC
(In reply to eisa01 from comment #1)
> What happens if you print the individual items in the list?
> 
> I assume the u prefix just means it's unicode format, so this is not a bug
> 
> If that is not the case, can you upload a test document and some description
> of how to test? I tried activating the Logo toolbar, but don't really
> understand how this works
> 
> https://www.w3docs.com/snippets/python/what-exactly-do-u-and-r-string-
> prefixes-do-and-what-are-raw-string-literals.html

Here I tried to print the suspicious LISTs (results after ->):
PRINT [u'W', u'o', u'r', u'd'] → Error (extra or missing spaces at brackets?)
PRINT [u'W', u'o', u'r', u'd'][0] → Error (extra or missing spaces at brackets?)

Here I printed correct LISTs:
PRINT [“Word”][0] → Word
PRINT ['ABC', 'DEF'][0] → ABC
PRINT [1, 2, 3][0] → 1
Hint: In LibreLogo you can get a single part of a LIST by its index in brackets, first element has index 0.
Comment 4 eisa01 2023-04-01 17:53:39 UTC
That seems all normal to me

If you print a data structure directly, don't be surprised if the programming language presents it like that. Loop through it and print the individual items if you want to print the contents

The following produces correct output, and using just "TEXT X" does not even work

PENSIZE 30
FILLCOLOR “PURPLE”
PENCOLOR “FUCHSIA”
SQUARE 360
FONTSIZE 80
x = (“ABC”, “DEF”)
TEXT x[0]
FORWARD 10
TEXT x[1]