[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Groff] maintain status b/w pic figures
From: |
Ted Harding |
Subject: |
RE: [Groff] maintain status b/w pic figures |
Date: |
Thu, 03 Nov 2005 18:00:59 -0000 (GMT) |
On 03-Nov-05 Amber Hassaan wrote:
> Hi everyone,
> Please tell me, if I can use variables or
> positions from one pic diagram in another pic
> diagram.I think I might be able to use self-defined
> registers or strings perhaps but I can't figure out
> how.
>
> best regards
> amber
Hi Amber,
Anything defined or given a value in one .PS ... .PE block
is available to all subsequent blocks, unless subsequently
changed.
So you can give a particular variable a value once, and it
will have that same value in all later blocks (unless you
change its value along the line).
Similarly, pic macros defined in one block remain available
in later blocks (unless undefined by "undef"), and so do
named "objects" defined like
A: [....]
and so on (actually pic calls [....] a "block", which is
obviously not what I meant by "block above!).
For example:
.PS
k = 10
define circles {
circrad=$1 ; n=$2 ;
for i = 1 to n do {
circle rad circrad*(1 - i/n) at (0 + i*circrad/n,0) fill i/n
}
sprintf(" %.0f Circles",k) at last circle .e ljust
}
.PE
and then, after some text,
.PS
circles(0.5,20)
.PE
which is clearly incorrect, so correct it with
.PS
k = 20
circles(0.5,20)
.PE
Best wishes,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 03-Nov-05 Time: 18:00:55
------------------------------ XFMail ------------------------------