From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 101deb,495b037244521cf3 X-Google-Attributes: gid101deb,public X-Google-Thread: 103376,22b2c05a8088bbb2 X-Google-Attributes: gid103376,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Leading zeros with Int_IO.Put()? Or another package? Date: 1996/11/22 Message-ID: <573mrl$3v2$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 198034801 references: <327FB8A3.745B@itg-sepg.logicon.com> <55ubsh$lh0$1@goanna.cs.rmit.edu.au> <56bi13$3pa$1@goanna.cs.rmit.edu.au> <328A0DDD.94B@lmtas.lmco.com> <56rgou$r4k$1@goanna.cs.rmit.edu.au> <56tjrh$4ak$1@goanna.cs.rmit.edu.au> <56trsm$f5a$1@goanna.cs.rmit.edu.au> <56u4vf$r65$1@goanna.cs.rmit.edu.au> <57381t$at8$1@goanna.cs.rmit.edu.au> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.lang.ada,comp.lang.pl1 nntp-posting-user: ok Date: 1996-11-22T00:00:00+00:00 List-Id: rav@goanna.cs.rmit.edu.au (robin) writes: > ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes: > >rav@goanna.cs.rmit.edu.au (robin) writes: > >>Now why would you bury a picture specification in a remote place from > >>the output statement that uses it? > >In order to be close to the *variable declarations* it will be used with. >That's back to front, isn't it! A layout isn't >used with variable declarations, it's used with I/O >operations. So it's logical that that's where it should >be. Nope. A layout is used to write *DATA*. It's not "where is it going" that determines what picture should be used, but "what am I writing". COBOL got this right: the picture is a property of the variable and is declared with it. (Well, nearly right. But at least it's _better_.) The point is that if I do DECLARE D DECIMAL(6,2); /* +/- $9,999.99 */ and 4000 lines later have PUT (D) EDIT(P'$9999.99'); then some day I am going to _change_ the declaration of D to DECLARE D DECIMAL(8,2); /* Money; limit has been raised to +/- $999.999.99 */ but the picture is _not_ changed. Better by far to have DECLARE D DECIMAL(6,2); /* money */ DECLARE D_PICTURE PICTURE ...whatever */ so that when the declaration of D is revised, the declaration of D_PICTURE gets revised to match. >I said "simpler" because that's exactly what it is. >It's clear and simple. I always thought the APL I wrote was clear and simple too. _I_ knew what it meant. Unfortunately, the APL system I was using was not an IBM one, and didn't conform _exactly_ to the ISO APL standard, and so the code didn't port very well because some of the boundary conditions were just _slightly_ different, and some of the things I'd used had no equivalent at all. In the same way, the PL/I thing is "clear and simple" - IF you already know PL/I pictures (I found knowing COBOL pictures was the reverse of a help with PL/I pictures, because the details were different), - IF you were letter perfect about the boundary conditions and what picture editing does in unusual case, and - IF the code is never maintained. In the same way, the formats in BASIC look really cute, but when you try to port or revise your program, watch out! -- Mixed Member Proportional---a *great* way to vote! Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.