[Solved] Multiline code in the [code] window

Let us know how we are doing -
Post Reply
User avatar
charlie.it
Volunteer
Posts: 417
Joined: Wed Aug 21, 2013 2:12 pm
Location: Italy

[Solved] Multiline code in the [code] window

Post by charlie.it »

Hi everyone, how do you see the multiline code in this forum? I see it like this in macOS 10.13.6 and Firefox or Safari, but there are three lines:
https://forum.openoffice.org/en/forum/v ... 51#p526751
Attachments
Schermata 2022-07-27 alle 16.16.36.png
Schermata 2022-07-27 alle 16.16.36.png (26.3 KiB) Viewed 3860 times
Last edited by MrProgrammer on Wed Aug 03, 2022 10:10 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
charlie
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1

http://www.charlieopenoffice.altervista.org
User avatar
MrProgrammer
Moderator
Posts: 4895
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Multiline code

Post by MrProgrammer »

charlie.it wrote: Wed Jul 27, 2022 4:22 pm how do you see the multiline code in this forum?
I use [pre] [/pre] tags:

SELECT
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF") As "F",
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM") AS "M" 
FROM
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF"),
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM")

What I type
What I type
202207271037.png (70.04 KiB) Viewed 3843 times
What I see with [pre]
What I see with [pre]
202207271040.png (79.85 KiB) Viewed 3843 times

But I can also use the [code] [/code] tags for multiline code. In your post, I see a single line in your code box. I don't have that problem when I use the code feature on MacOS and Safari.

Code: Select all

SELECT
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF") As "F",
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM") AS "M" 
FROM
   (SELECT COUNT( "Gender" ) AS "F" FROM "R_GenderF"),
   (SELECT COUNT( "Gender" ) AS "M" FROM "R_GenderM")
What I see with [code]
What I see with [code]
202207271110.png (56.21 KiB) Viewed 3837 times
charlie.it wrote: Wed Jul 27, 2022 4:22 pm but there are three lines:
Explain why you believe there are three lines. I see only one.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Multiline code

Post by Hagar Delest »

MrProgrammer wrote: Wed Jul 27, 2022 5:41 pmIn your post, I see a single line in your code box.
+1 (on my xubuntu machine with Firefox). Thus, it doesn't seem strange for me.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
charlie.it
Volunteer
Posts: 417
Joined: Wed Aug 21, 2013 2:12 pm
Location: Italy

Re: Multiline code

Post by charlie.it »

Sorry I expressed myself badly (my English! :oops: ), I meant that a part of the code remains hidden on the right side instead of being all visible.
Is it a problem of my browsers?
charlie
Italian AOO Admin
macOS 14 Sonoma M1: Open Office 4.1.15 - LibreOffice 7.5.7.1

http://www.charlieopenoffice.altervista.org
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Multiline code

Post by Hagar Delest »

Don't remember on my xubuntu machine but on my Windows 10 machine this morning, I see the horizontal slider with Brave:
Slider.png
Slider.png (4.42 KiB) Viewed 3784 times
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
robleyd
Moderator
Posts: 5055
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Multiline code

Post by robleyd »

With Safari on iOS (iPad) there is no scroll bar, until you drag the contents. On Waterfox (Linux), the scroll bar appears as expected
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.1.2; SlackBuild for 24.2.1 by Eric Hameleers
User avatar
MrProgrammer
Moderator
Posts: 4895
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Multiline code

Post by MrProgrammer »

Safari 14.1.2 on MacOS 10.14.6 also shows a scroll bar for your code window.
Screen capture from the Count Request Fail post
Screen capture from the Count Request Fail post
202207280838.png (92.93 KiB) Viewed 3755 times

charlie.it wrote: Wed Jul 27, 2022 4:22 pm there are three lines:
When I use pre tags, I am telling the editor that I have preformatted the text so leave it alone. Use a monospace font, do not suppress multiple spaces, do not left-justify by removing leading spaces, and do not wrap it at word boundaries. Since the text isn't word wrapped automatically, it is my responsibility to ensure that the lines are short enough so the content can be viewed as desired. I hardly ever use code tags but I believe this indicates that the editor should use a monospace font and is never allowed to wrap the text, thus it's best to keep the lines short, as I did with the code window in my previous post by adding NewLines as needed. When you add NewLines, the code window will provide a multiline display. But your code window does (for me) provide a horizontal scrollbar so I can view long lines. I have modified your subject line for the topic to clarify that you are asking about the code window.

robleyd wrote: Thu Jul 28, 2022 9:06 am With Safari on iOS (iPad) there is no scroll bar, until you drag the contents.
iPads have relatively small screens. So Apple likes to hide scroll bars unless on them because they use valuable screen real estate. There may be a Setting which helps one control this behavior. If not, I understand that Apple just wants to keep the user interface simple, since that is what most customers need.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Multiline code in the [code] window

Post by Hagar Delest »

On my xubuntu machine with Firefox, the slider appears only when the mouse hovers the area.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply