DesktopListbox.AddRow adds spaces…

I automatically add Rows to a List Box some default values (index, dates), then add manually some data.

I noticed two spaces in empty Cells AND a leading space in the Index Column.

The Dates have a leading and trailing spaces…

That is (of course) in the ListBox and in the saved csv, txt…

Current macOS and Xojo.

Can you share a sample project that shows this problem?

I took some minutes to creates one, but… surprise: no extra spaces added !

I will compare the new code from the documentation vs the one in my project (yes, I do not understand).

I come back once the compare is done with the results. (I will start adding the Edit Mode to the example to be features on par).

I confirm: I do not understand.

I will copy / paste directly the code used to populate the List Box from my project into the sample to be sure… eventually !

Done, I still do not understand.

I only change the way some properties are taken from the window (say initialize two Dates, set the indice value, and the List Box reference to AddRows…

The Method calling code is in Opening event vs a button. That is all the changes I’ve done.
The example List Box is Cell Editable with the project code.

I give-up.

LBN: INCREDIBLE, the bad behavior does no more exits ! And I changed nothing (only some reboots)…

In fact, I noticed a strange behavior while importing a .csv file another project export, noticing the same “trouble” (space where there are none before), and searched why.

After a while, I discovered that my memory failed when adding quotes to each Cell: I added a space. Prior that I added a !…

In short, I started with Chr(33), see the error, changed the value to Chr(32) (*) instead of Chr(34) !

(*) I knew when I typed [“Chr(32): this is a space ?”] that there is an error, but since Chr(34) does not comes to mind I let it as is…

Then, I moved that code to this project, of course I totally forgot (until now) what I have done and when I used this project I noticed the added spaces.

This mystery is now resolved.