|
From: Ulrich H. <uh...@xl...> - 2007-03-15 19:34:18
|
> Is there a possibility in amforth or do I have to make it all
> by myself (with <# # #> ....)
Hi,
for right adjusted number output you often find the words .r or u.r
as in:
\ amforth
: spaces ( u -- ) ?dup if 0 do space loop then ;
: u.r ( u w -- )
>r <# #s #> r> over - 0 max spaces type ;
w specifies the width of the field, where the number is
displayed right aligned, like this:
> 100 12 u.r
100 ok
> 10 12 u.r
10 ok
> 1 12 u.r
1 ok
>
Regards,
Ulli
|