Page 2 of 7

Re: issue-#146 TextRulers docu improvements

Posted: Wed Jun 07, 2017 7:03 am
by Zinn
We can life with this problem and ignore it.

Well, an ugly wrap around is to write a comma (or decimal point) at the end of the first number as we do by real numbers.
Robert suggest another solution, but than we get a lot of new different kinds of tab stops.

Let us implement my rules and get some experience with it. One more kind of tab stop is enough.

- Helmut

Re: issue-#146 TextRulers docu improvements

Posted: Wed Jun 07, 2017 8:42 am
by Josef Templ
Formatted as CP literals 123.456 means 123456 and 123.456,78 means 123456.78.
The "." is used for grouping 3 digits, the "," is the radix character (in German).
With the proposed rule it would be formatted as

Code: Select all

    123.456
123.456,78
It is interesting that OpenOffice (and also WordPerfect) treats it differently than MS Word.
In OpenOffice you can select any character as the radix character while in Word
it is always the global user's setting. I was asking myself if there is an explanation for this
"strange" behavior of Word.
My conclusion is that Word is optimized towards program generated data.
If you have a Word macro that fills in the data in a Word document that macro typically localizes the formatting
of numbers and the 'program' then works in any region. The 'input' is portable not the
'output'. This behavior cannot be achieved with Openoffice, I think.

Texts can be program generated in BlackBox too.
For example, I have a report generator for BlackBox but it is hard-coded to use german formatting only.
Currently there is no portable way to get the user's setting, I think, and there was no need so far to extend that.
But it is a limitation with respect to supporting localization.

(I certainly don't want to make it more complicated than required but I am trying to understand the
problems involved.)


For the implementation it should also be considered how decimal tabs can be converted to RTF and HTML.


Another issue is if the triangle+underline for a tab in a ruler shouldn't better be replaced by the
more usual symbols L, inverted T, etc.


And finally a question: in which case is the ":" required as the radix character?

- Josef

Re: issue-#146 TextRulers docu improvements

Posted: Wed Jun 07, 2017 5:14 pm
by Robert
Josef Templ wrote:And finally a question: in which case is the ":" required as the radix character?
I have no idea why I put it in; I can't ever remenber using it. But maybe it is useful for times?

Once we decide what behaviour we want, the changes to my code to implement that should be relatively easy.

But I am making no progress on the two major 'bugs'.

1 - If a text ends with a decimal tabbed field (no end-of-line) it is not correctly positioned. I think this should be simple to fix, but I can't find the solution, which is frustrating. And the symptoms are mildly annoying, even though I have lived with them for years.

2 - Fields with '-' signs (ASCII Hyphen 2DX) are mishandled, because the Setter treats this specially as a possible line-break opportunity. I have no idea how to address this issue, which is a major problem for most people. It is not a problem for me as I prefer to use '−' (Unicode minus 2212X), and that can be handled easily. (In most fonts it looks much nicer.)

Re: issue-#146 TextRulers docu improvements

Posted: Thu Jun 08, 2017 2:27 am
by luowy
Zinn wrote:Is it possible to add decimal point tabs to TextRulers? How to do it? How much work is it?
- Helmut
what is the "decimal point tabs"? i have no idea about it. can anyone explain it to me? with a small example is welcome.

Re: issue-#146 TextRulers docu improvements

Posted: Thu Jun 08, 2017 11:36 am
by Josef Templ
luowy wrote:
Zinn wrote:Is it possible to add decimal point tabs to TextRulers? How to do it? How much work is it?
- Helmut
what is the "decimal point tabs"? i have no idea about it. can anyone explain it to me? with a small example is welcome.
luowy, please look into Word or OpenOffice.
Set a tab stop in the ruler and double click on it.
You will see a window popping up that offers several tabulatur settings: left, right, center, and "decimal".
A decimal tab is aligned at the radix character of a number, if it has one, typically the "." in an english region and the "," in german.

- Josef

Re: issue-#146 TextRulers docu improvements

Posted: Thu Jun 08, 2017 9:50 pm
by Robert
luowy wrote:what is the "decimal point tabs"?
See the third column below.
Comparison of Tab types
Comparison of Tab types
TabTest.png (4.31 KiB) Viewed 30799 times

Re: issue-#146 TextRulers docu improvements

Posted: Fri Jun 09, 2017 12:41 am
by luowy
thanks,I got it. now, I can understand what the problem is.

Re: issue-#146 TextRulers docu improvements

Posted: Fri Jun 09, 2017 5:30 am
by luowy
Robert wrote: But I am making no progress on the two major 'bugs'.

1 - If a text ends with a decimal tabbed field (no end-of-line) it is not correctly positioned. I think this should be simple to fix, but I can't find the solution, which is frustrating. And the symptoms are mildly annoying, even though I have lived with them for years.
a small fixup, @ TextSetters.GatherString

Code: Select all

....
		rd.string[i] := 0X; rd.setterOpts := {wordJoin};
		IF rd.blockIsTail THEN rd.zone := '' END;
		rd.blockIsTail := (ch = tab) OR (ch = line) (*>>*)OR(ch=0X)(*<<*);
...
It seems to work. I not test a lot.

issue-#163 Adding 'Decimal' Tabs to Rulers

Posted: Fri Jun 09, 2017 8:29 am
by Robert
I am moving the discussion on this topic from the Resolved topic "TextRulers docu improvements".

Re: issue-#146 TextRulers docu improvements

Posted: Fri Jun 09, 2017 9:54 am
by Robert
luowy wrote:
Robert wrote:I think this should be simple to fix, but I can't find the solution ...
a small fixup

Code: Select all

 ... OR(ch=0X);
Brilliant - I'm sure that is what is needed here.
I tried all kinds of things, such as looking at Reader.eot and Reader.r.eot, but missed the obvious (well, obvious in hindsight).