I am concerned about a possiible algorithm error when Sesame is printing justified text. History is here:
--------------------------------
In the March 2005 issue of Inside Sesame,
Tom Marcellus has provided some excellent code to drop into any form, and send a printout of the current record to your default printer. All source code is there for you to modify, but only one variable really needs to change: that is the name of a Key Element name for the Report Header.
I have used it on a command button on a number of forms with only making that one change.
All was going well until I started printing out one element that was a bit different from all the others. The element is a Multi-Line, Left Justified, all UpperCase text element.
When this element was being printed I noticed that sometimes the right side was being clipped.
For references, I am using original vFont = BArial., vSize=12. The only changes I made were to vSize in this one section of the code.
I spent a number of hours exchanging emails and tests with Tom, and we agreed that there was no programming error. But Sesame seems to be handling the justification calculations inconsistently. Near the end of the code is the section that prints the value of the element. Only one code value was changed, the vSize which was predefined as vSize as Integer =12. The defined font was BArial. We tested with and without Bold and found that Size seemed to be the controlling factor. Bold and Unbold had similar results. Does not appear to be a function of width. Clipping occurred when width was changed from 650 to 450 and 750. Also got similar results on different printers.
Here is the code that was being analyzed:
---------------------
If Not @IsBlank(ThisElement) Then {
vThisElement = @Replace(ThisElement,
@Newline() + @NewLine(), @NewLine())
PrintString(vThisElement, @PageExtentX() +
10, -1, 650, vFont,
vSize, 0)
}
-----------------------------
Summary of tests that were done:
1. The original program called for vSize (=12), copy was clipped.
2. Changing vSize to 9 or 10 resulted in good printing.
3. Changing vSize to 11, 12, 13, 14 resulted in clipped printing.
4. Since 12 is the same as vSize, it was strange to notice that the clipping was not the same, each had different spacing.
5. Because of 12 not showing the same as vSize, I tried using @ToNumber(12), and that ended up with a third different clipped result for "vSize=12".
--------------------------------------------------------------
Next section is not really code, but used to help align columns, inserting Table was not working.
Value Result
vSize Clipped
12 Clipped, but different
@TN(12) Clipped, with third difference
9 OK
10 OK
11 Clipped
12 Clipped
13 Clipped
14 Clipped
It would seem to me that Sesame probably may have some type of algorithm problem when trying to calculate justification. I have changed my application to use "10" vs. vSize so I can deliver to client.
Short term work-around is to use size of 10 or lower. But longterm solution will be needed.
Has anyone else seem a similar problem?