From: Ulrich H. <uh...@xl...> - 2007-03-15 23:56:02
|
Hi Joh, amforth's <# # #> do not work with double cell numbers but only with single cell numbers. gforth's work with double cell numbers. So for gforth you either define \ gforth : u.r ( u w -- ) >r 0 <# #s #> r> over - 0 max spaces type ; 5 10 u.r 5 ok or you use the original definition with double precision numbers: \ gforth : ud.r ( d w -- ) >r <# #s #> r> over - 0 max spaces type ; 5. 10 ud.r 5 ok amforth slightly diverges from Standard Forth behavior here. Regards, Ulli Am Mar 15, 2007 um 11:38 PM schrieb joe...@t-...: > > -----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 > > > > ----------------------------------------------------------------------- > -- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel > |