Good explanation Brett,

Most newcomers to rebol seem to pick up modifying
strings before modifying code blocks. What's so
difficult about modifying blocks of code?
The magic word is:

        compose

I use this on a regular basis. Everyone needs
to know how it works. It is cool. It is also
necessary for composing your code blocks in a
clean way.

Although I am not really expecting it here on this
list, I don't see a script header. If you are not
using script headers, I recommend them to you and
anyone else reading. All my scripts have them.

You can see Rebol Technologies standard header here:

        probe system/standard/script

I think the most important fields are:

        Title, Date, Version, Author and Purpose.

Anton.

> Hi Louis,
> 
> > Here is how I am using pdf-maker.r to print out my reports (I would 
> > appreciate any advice on how this can be improved):
> 
> Your code is constructing REBOL script inside a script which the people
> at RT find aesthetically disturbing :^) You do not need to do this.
> This is also the reason for those two replacement lines. 
> 
> Constructing blocks of REBOL script can be just as easy or easier than
> contructing strings. In this case is it much simpler.
> 
> I have changed your code to construct a block that represents a page in
> the pdf-maker dialect. Then I add the page block to the document block.
> Finally the pdf-layout function is applied to the document block.
> 
> This has the nice side effect that when reading the new program you can
> see the page relatively clearly. More importantly I think it is easier
> to modify. 
> 
> REBOL []
> do %pdf-maker.r
> if exists? %pig.pdf [delete %pig.pdf]
> count: 0
> lets: copy [{AAAAAAAAA} {BBBBBBB} {CCCCCC}]
> pdf-document: copy []
> foreach let lets [
>     page: compose/deep [
>         textbox [font Courier 4.4 as-is (:let)]
>     ]
>     append/only pdf-document page
>     count: count + 1
> ]
> write/binary %pig.pdf layout-pdf pdf-document
> browse %pig.pdf
> ask "Continue? "
> delete %pig.pdf
> 
> I hope that this helps you get some sleep :^)
> 
> Brett.

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to