From: <joe...@t-...> - 2007-03-15 22:39:03
|
-----Original Message----- > Date: Thu, 15 Mar 2007 20:34:08 +0100 > Subject: Re: [Amforth-devel] formated output > From: Ulrich Hoffmann > To: Everything around amforth > > 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 ; That leads to a stack underflow (as tested in gforth) > 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 > > > Thanks for your ideas. Greetings joh |