M. Sapiyan (yan@uk.ac.keele.cs) wrote:
> 0, 100, 200 etc., since the third arguement of rc_print_at has to be a string.
> Is there a `better' way of doing this, so as to accomodate for changes in the
> scale? Is there a command that prints out a value of a variable instead of
> printint a string?
> =======================================
> ;;; draws the x-axis
> XpwSetColor(rc_window, 'black');
> rc_drawline(-450,0,450,0);
> for c from -450 by 100 to 450 do
> rc_drawline(c,0,c,-5)
> endfor;
> rc_print_at(-453,-17,'0');
> rc_print_at(-361,-17,'100');
Any data item can be converted to a string by using the >< operator.
Unlike <> (which concatenates two objects of the same type), >< concatenates
*any* two objects and returns a string containing their "print"
representation.
So:
123 >< '' =>
** 123
datakey(123 >< '') =>
** <key string>
for c from 0 by 100 to 900 do
rc_print_at(c - 453, -17, c >< '');
endfor;
Ian.
--
<a href=http://www.cogs.susx.ac.uk/users/ianr/>Ian Rogers</a>
|