Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: comp.arch Subject: Re: MIPS to offer COBOL Message-ID: <4159@utcsri.UUCP> Date: Tue, 17-Feb-87 23:30:27 EST Article-I.D.: utcsri.4159 Posted: Tue Feb 17 23:30:27 1987 Date-Received: Wed, 18-Feb-87 21:31:50 EST References: <14392@amdcad.UUCP> <28200006@ccvaxa> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 34 Summary: In article <28200006@ccvaxa> aglew@ccvaxa.UUCP writes: >Talking about which - has anybody got a picture formatting package >for C? Pictures are damned nice at times. It could probably be >wired into printf formats like this: > > printf("%P[$$$,$$$,$$$,$$9.99]",number); > >Andy "Krazy" Glew. Gould CSD-Urbana. USEnet: ihnp4!uiucdcs!ccvaxa!aglew >1101 E. University, Urbana, IL 61801 ARPAnet: aglew@gswd-vms.arpa The problem here is that COBOL pictures are designed to be nice to look at but are not the best representation for controlling run-time conversion. The best way might be a preprocessor, which would convert from: printf( "total: %p\n", PIC($$$,$$$,$$$,$$9.99), number ); to: static struct { char *pic_background; short pic_dp,pic_flags } _pics[]={ ... { "000 ", 2, _PIC_LEFT_DOLLAR | _PIC_COMMAS }, ... }; ... printf( "total: %p\n",&_pics[6], number ); ...or something like that. The intended meaning of all this is left as an exercise :-) -- ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg Have vAX, will hack...