HP3000-L Archives

May 2010, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tracy Pierce <[log in to unmask]>
Reply To:
Tracy Pierce <[log in to unmask]>
Date:
Thu, 27 May 2010 09:38:27 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (105 lines)
> But is it just me who tries to go for the super-generalisation?
>
no, Roy, it's not just you; that's a requisite trait of a good programmer imho.  

even with all the source code handy and the ability to make a global change to all the linkage sections easily, I'd still seek the subprogram-only solution even if the only benefit turned out to be having one copy of the magic bit of code instead of many.

for this case, in which i suspect it's a new member of the flock that's running in "the other mode" and needs the subprogram to do the same, the easy solution might well be to have the rogue program set an environment variable that the subprogram can seek and if found run in the specified mode otherwise stick to the original scheme.  

tracy pierce


> -----Original Message-----
> From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf Of
> Roy Brown
> Sent: Thursday, May 27, 2010 2:44 AM
> To: [log in to unmask]
> Subject: Re: BLOCK MODE VARIABLE
> 
> I like this technique, and will take note of it for the future.
> 
> But is it just me who tries to go for the super-generalisation?
> 
> Imagine a big, established suite of programs, already calling this
> subprogram from more than a few places, but a new requirement means it
> suddenly has to know if it was called while the program calling it had
> the terminal in block mode or character mode.
> 
> Linkage, External or whatever, you are going to fight very shy of making
> all those calling places have to keep track of which mode they are in,
> in a variable, a JCW or VAR, or even an Image dataset, so that the
> subprogram can read this.
> 
> Easier, more reliable, and safer by far, to have the subprogram figure
> this out for itself if it wants to know which mode the terminal is in,
> and leave the rest of the suite absolutely unchanged.
> 
> Seeing a problem like this, I tend to make the jump from 'how do I tell
> the subprogram which mode?' (as Walter says, possibly in many places) to
> 'how does the subprogram figure this out?' almost without thinking about
> it.
> 
> And only go back to disturbing the established system to provide this
> new information if, with my tail between my legs, I conclude that it's
> something the subprogram just logically *cannot* figure out for itself.
> 
> Roy
> 
> 
> In message <000001cafd4e$8991a360$6601a8c0@DJFJQK21>, Walter J. Murray
> <[log in to unmask]> writing at 20:41:48 in his/her local time
> opines:-
> >Mike asks how to pass data to a subprogram without using a Linkage
> >section.
> >
> >Assuming the main program and subprogram are both COBOL, here's a handy
> >technique I have used to pass data between them without using parameters
> >and a Linkage Section.
> >
> >Define data items in the Working-Storage Section of both the main
> >program and the subprogram.  Give them both the same name (important!)
> >and the same Picture clause, and declare them both as EXTERNAL.  A value
> >stored in such a data item by one program will be "seen" by the other.
> >
> >It's a handy way to pass additional data between a program and a
> >subprogram, without having to change the calling sequences (in possibly
> >many programs).
> >
> >Walter
> >
> >Walter J. Murray
> >
> >
> >-----Original Message-----
> >From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
> >Behalf Of Michael Caplin
> >Sent: Wednesday, May 26, 2010 8:20 AM
> >To: [log in to unmask]
> >Subject: [HP3000-L] BLOCK MODE VARIABLE
> >
> >I have a subprogram that can be called from a block or character mode
> >main
> >program and I want the sub to know which called it without anything
> >being
> >passed in linkage.  I can think of some ugly ways to do it.  Does anyone
> >know
> >of an easy/simple way.
> >TIA,
> >mike
> >
> >* To join/leave the list, search archives, change list settings, *
> >* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
> >
> >* To join/leave the list, search archives, change list settings, *
> >* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
> 
> --
> Roy Brown        'Have nothing in your houses that you do not know to be
> Kelmscott Ltd     useful, or believe to be beautiful'  William Morris
> 
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2