Re: Reset data
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Feb 2007 21:40:18 +1300
"Arnold Trembley" <arnold.trembley@xxxxxxxxxxxxxxxx> wrote in message
news:BC6Fh.19799$as2.5112@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Pete Dashwood wrote:
"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:chv5u214c3r2strckf1h2r8msh9pv42ne5@xxxxxxxxxx
(snip)
One thing I sometimes do in a program with such a table (especially if
some of the variables are packed or binary), is to create an
initialization table. If I need to reinitialize the table, I just
MOVE ZERO-TABLE to TABELLE.
Again, something I don't understand.
How would the result of doing that (taking twice as much storage as you
actually need, and running the risk of forgetting to update one of the
tables when the structure changes) differ from...
INITIALIZE TABELLE ?
Pete.
If you are INITIALIZE'ing a structure, the generated code will have an
explicit move for each elementary field. I know it works this way in
Enterprise COBOL for zOS.
Yes, I think it works that way on most platforms.
My question then is: So what?
The art of computer programming (now rapidly becoming a lost art, thanks to
extremely powerful processors and virtual address spaces with almost
unlimited capacity) comes down to balancing space against time. Give a
program more space and it usually runs faster. In this case you are saying
that the size of a second table will be less than all the move statements
required to initialize it, if INITIALIZE is used. So, it is the second table
and a single group move, against the elemental moves required for each
element.
But there is still the question of maintenance and the overall inelegance of
a second table that serves no purpose whatsoever, other than to initialize
the original structure.
Sorry, that doesn't cut it for me...
INITIALIZE gets my vote.
Pete.
.
- Follow-Ups:
- Re: Reset data
- From: Rick Smith
- Re: Reset data
- References:
- Reset data
- From: Mitch Steens
- Re: Reset data
- From: Howard Brazee
- Re: Reset data
- From: Pete Dashwood
- Re: Reset data
- From: Arnold Trembley
- Reset data
- Prev by Date: Re: Reset data
- Next by Date: Re: Reset data
- Previous by thread: Re: Reset data
- Next by thread: Re: Reset data
- Index(es):
Relevant Pages
|