Copy the result of CHAR(9) of Calc formula and paste in LibreOffice CALC BASIC IDE

=CONCAT(CHAR(9),"oSheet.getCellByPosition(",A2,", ",B2,")",".String = ","""",C2,"""")

The result CHAR(9) is only a space character in the IDE.

image description

Tab length in the IDE is 4.

How can Calc formula with CHAR(9) send the same tab length of the IDE ?

C:\fakepath\LOCalcBASIC_InsertTabInFrontOfCodeUsingChar(9).ods

There is no defined length for

I’m not sure I understood from your description what you really want to achieve. Do you need a tab character in a cell? Or do you want to visually move the text in a cell away from the left border? In the first case, something like oSheet.getCellByPosition(0, 0).String = Chr(9)+"ABC Co., Ltd." will do the job. But visually, the text in the cell will remain pressed against the left border, the tabulation character in Calc is not a formatting character. To shift the text in a cell visually to the right, use Alignment - Left - Indent

Tab length in the IDE is 4.

you answer the question!

=CONCAT("    ",…

Dear @Karolus,

From your idea,

  • I copied a tab in front of Dim of line 4 in IDE and placed in the formula instead of CHAR(9).

    The result was the same.

  • I modified the formula,

    =CONCAT("[1tab]",“oSheet.getCellByPosition(”,A2,", “,B2,”)",".String = “,”""",C2,"""")

and copied the result and placed it in the IDE.

[1tab]oSheet.getCellByPosition(0, 0).String = "ABC Co., Ltd."

And Ctrl + h to replace [1tab] with a tab I copied from in front of Dim of line 4 in IDE.

This works but not so convenient.

Your formula works for me

=CONCAT(CHAR(9);"oSheet.getCellByPosition(";A2;", ";B2;")";".String = ";"""";C2;"""")

in the cell, but the TAB is invisible in the cell.

When I Copy/Paste the concatenated formula from one cell into the Basic code in the IDE, the TAB character is appered normally: it is not 4 spaces really, but it is one TAB character with 4 character width.
I am using a normal Copy/Paste (without any “unformatted text” or other option).

But it will be appeared only a space at the begin of the code lines, when I Copy-Paste the whole desired Cell Range in same time.
(Win 10Profx64, LO647x64)

Dear @Zizi64,

Thank you for the comparison, I also got this result and it works in LO/Windows 10.

So, I will report to request this feature in Linux.

(I am using Fedora 34 Workstation Edition.)

It can be done in either in Windows 10 or Linux, Fedora 34 Workstation Edition, but only copy & paste cell by cell, not by a cell range.

Fedora 34 Workstation Edition

LibreOffice 7.1.3.2

Windows 10

LibreOffice 7.1.1.2