[BR_forum] NWP Printing
Posted: Thu Aug 21, 2008 8:38 am
Thinking about it, I realise you probably want the example in a proportional font, duh!
Here you go.
The program that generates this output (copy and pasted directly from my editor) is:
00001 open #1: "name=preview:/",display,output
00002 !
00003 print #1: "[Box][SetFont(Times)]"
00004 print #1: "|Here is my First | and second Columns|"
00005 print #1: "|My invoice grid | is easy to make |"
00006 print #1: "| with NWP because| I can see the |"
00007 print #1: "|Columns as they lineup with eachother|[BoxTop]"
00008 print #1: "|These two bottom rows have one big |[BoxBottom]"
00009 print #1: "|box |[/Box]"
00010 close #1:
Isn't it neat how you can draw your grid using pipe symbols (|) in the non-proportional font BR editor, and have it still line up perfectly in the proportional font real world? You'll notice I did not change any lines of this program except the font from my original example. Everything else worked fine on its own.
Gabriel
On Thu, Aug 21, 2008 at 9:25 AM, Gabriel Bakker <gabriel.bakker@gmail.com (gabriel.bakker@gmail.com)> wrote:
Post generated using Mail2Forum (http://www.mail2forum.com)
Here you go.
The program that generates this output (copy and pasted directly from my editor) is:
00001 open #1: "name=preview:/",display,output
00002 !
00003 print #1: "[Box][SetFont(Times)]"
00004 print #1: "|Here is my First | and second Columns|"
00005 print #1: "|My invoice grid | is easy to make |"
00006 print #1: "| with NWP because| I can see the |"
00007 print #1: "|Columns as they lineup with eachother|[BoxTop]"
00008 print #1: "|These two bottom rows have one big |[BoxBottom]"
00009 print #1: "|box |[/Box]"
00010 close #1:
Isn't it neat how you can draw your grid using pipe symbols (|) in the non-proportional font BR editor, and have it still line up perfectly in the proportional font real world? You'll notice I did not change any lines of this program except the font from my original example. Everything else worked fine on its own.
Gabriel
On Thu, Aug 21, 2008 at 9:25 AM, Gabriel Bakker <gabriel.bakker@gmail.com (gabriel.bakker@gmail.com)> wrote:
I just tested the example I gave and it produced the output in the attached files. I printed it to pdf, and I have attached the pdf. However, I also converted the pdf to a gif to make it easier to view if you want. I have attached both copies.
The bottom three rows have only one column each, however the grid still lines up.
The bottom two rows are really one big row, two high.
Isn't it easy to "draw" grids on your reports or invoices? The fact that cursor advances makes it even easier then in other languages. (It definitely doesn't advance arbitrarily.)
Gabriel
On Thu, Aug 21, 2008 at 9:14 AM, Gabriel Bakker <gabriel.bakker@gmail.com (gabriel.bakker@gmail.com)> wrote:The reason the cursor advances when you embed the | and [|] sequences is because Gordon wanted you to be able to draw your grids with |'s and have your grids just appear on the page the way you drew them.
[Box]
|Here is my First | and second Columns|
|My invoice grid | is easy to make |
| with NWP because| I can see the |
|Columns as they lineup with eachother|[BoxTop]
|These two bottom rows have one big |[BoxBottom]
|box |[/Box]
The goal was to make it so that you can draw your grids in the BR editor and they would magically work in your print jobs.
Gabriel
2008/8/21 Rickie Graham <rdgcss@attglobal.net (rdgcss@attglobal.net)>
As far as I tell the cursor has always advanced when embedding escape sequences or printer substitution into the print stream. An easy way to prove this is to open the printer with a short recl= and insert a bunch of printer substitution commands, you will get a line wrap (BR inserts a CRLF). As far as I can tell, this is because the printer substation doesn't occur until the printer stream leaves the print buffer, just before it is sent to the actual printer (Spooler).
Rick Graham
From: br_forum-bounces@maillist.ads.net (br_forum-bounces@maillist.ads.net) [mailto:br_forum-bounces@maillist.ads.net (br_forum-bounces@maillist.ads.net)] On Behalf Of david@masterstouch.net (david@masterstouch.net)
Sent: Thursday, August 21, 2008 12:02 AM
To: Business Rules Forum
Subject: Re: [BR_forum] NWP Printing
No, It aught to work but...
Your example had no absolute location for alignment. The "box" method is fine if you don't care where the text prints and you let Gordon do it. Try drawing some lines and position the text at a specific point. I hope this is just some more of "Gordon has no idea of what he is doing here" and he can and will fix it. When you send the printer an escape sequence (such as right justify) the cursor should not be advanced by the length of the command string! That is the way the real world works but not 4.18! The codes for left and right justify advance the cursor (different amounts and without apparent consistency)
When you position the cursor to print text, that is where the text should be printed but for the right and left justify to work, it must be immediately follow by the text to be impacted. The cursor has been advanced and the text (while right aligned) is to the right of where it should be. The result is you must "guess" at some point to the left of where the actual text should print, send the escape sequence and the text such that it hits in the right spot. This is very much a trial and error.
It is my hope that this can be resolved. Essentially any escape sequence (other than a position command) should execute without advancing the cursor, something like "[PUSH] escape seq [POP]". By the way this does not work even if you are willing to go to the trouble because the text must follow the command.
I get so frustrated trying to do "real" things with BR that is not ready for prime time (the above only works in 4.18!) When these "features" are added, they seem to be added as a band-aid instead of a planned implementation. It makes me think that the people writing the code have never tried to produce a true proportional font output - in any language!
I may try to write Gordon but my frustration is sure to come shining through.
David
-----Original Message-----
From: George Tisdale [mailto:GTISDALE@tisdalecpa.com (GTISDALE@tisdalecpa.com)]
Sent: Wednesday, August 20, 2008 10:07 PM
To: 'Business Rules Forum'
Subject: RE: [BR_forum] NWP Printing
No, this is the last send and demonstrates the use of column alignment in NWP.
The program below uses to for next loops to print stuff to an NWP document.
The first one does so using a normal BR FORM statement, the second one is a bunch of text strung together with [|] separating the strings. Similar results, however in the second one the "X"s eventually exceed the field length and start pushing the column to the right - not what you want. So the first option is preferable using the form statement. You will need to play with the C values in the form statement to get your amounts in the right places. But it will work nicely.
George
From: br_forum-bounces@maillist.ads.net (br_forum-bounces@maillist.ads.net) [mailto:br_forum-bounces@maillist.ads.net (br_forum-bounces@maillist.ads.net)] On Behalf Of david@masterstouch.net (david@masterstouch.net)
Sent: Wednesday, August 20, 2008 9:29 PM
To: Business Rules Forum
Subject: Re: [BR_forum] NWP Printing
I was pretty sure you sent me something after the email below but I must have inadvertently deleted it. This is the first chance I have had to work on this program since Monday night late. If you did sent one after this one (below), could you re-send it?
Thanks.
David
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.6.6/1625 - Release Date: 8/21/2008 6:04 AM
_______________________________________________
BR_forum mailing list
BR_forum@maillist.ads.net (BR_forum@maillist.ads.net)
http://maillist.ads.net/mailman/listinfo/br_forum
Post generated using Mail2Forum (http://www.mail2forum.com)