Re: Reset data



Pete,
Although NOT related to this specific example, there was one time that there
USED to be a "good reason" for using
Move Table1 to Tabl
instead of
Initialize Tabl

In the '85 Standard (when INITIALIZE was introduced) it was "non-conforming" to
try to INITIALIZE a record that included an OCCURS DEPENDING ON item in it, i.e.
a "variable occurrence table". Although SOME vendors provided extensions to
allow this, it was not made "legal" source code until the '02 Standard.
Therefore, one could initialize a full table (including various Comp-? fields)
only by "saving" an initial value table and moving it to the target one.

There was also the whole question of whether one did or did not want to
initialize FILLER fields and initialize "to VALUE clause". Again, both of
these were made "standard" in the '02 Standard, but were only available as
extensions in a FEW compilers before that.

Again, for THE specific example, below, using the "MOVE ZERO-TABLE to TABELLE"
seems unnecessary. Also, as all the fields are DISPLAY NUMERIC without SIGNS, I
would guess that a MOVE ZERO should work OK (although I have rarely seen
'real-world' examples where this works as desired).

--
Bill Klein
wmklein <at> ix.netcom.com
"Pete Dashwood" <dashwood@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:54k41rF20ig9pU1@xxxxxxxxxxxxxxxxxxxxx

"Howard Brazee" <howard@xxxxxxxxxx> wrote in message
news:chv5u214c3r2strckf1h2r8msh9pv42ne5@xxxxxxxxxx
On Mon, 26 Feb 2007 10:13:41 +0100, "Mitch Steens" <M.Steens@xxxxxxx>
wrote:

I have the following datatype:

03 tabelle.
05 occurs 9.
07 occurs 9.
10 elem.
12 elem-a pic 9.
12 elem-b pic 9.

How can I reset the datatype, so that no value is set?

What do you mean by "no value". This is space in the computer
memory. Whatever happens to be in memory is a "value", whether or
not if it is a valid value.

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.



.



Relevant Pages

  • Re: Copying pthread_t
    ... Where is this different from all the other functions in the standard? ... object is modified through one pointer while the other pointer is ... each 'pthread_t' could have some memory allocated to ... initialize a pthread_t is by one of the pthread_* functions like ...
    (comp.programming.threads)
  • Re: simulating xilinx block ram with modelsim
    ... The test bench should initialize memory ... attributes of the BLKRAM to initialize values. ... well of course i checked my input signals and i applie values to them. ...
    (comp.arch.fpga)
  • Re: If forget to fclose() after fopen(), is there any testing tool who can detect it automatically?
    ... >> We all know that fclosemust be called after file operations to ... >> importance of freeing the allocated memory, ... Wherever you declare the FILE* variable, initialize it to NULL. ... Initializing FILE pointers to NULL when they are ...
    (comp.lang.c)
  • Re: Problem only in release version!
    ... not executed in Release mode (I believe, but I also thought Debug ... initialized variables to zero, ... The Release version will not initialize anything 'naturally' ... >>the contents of the memory addresses they happen to get assigned to). ...
    (microsoft.public.dotnet.languages.vc)
  • Re: random error occuring - cannot find dbnetlib.dll
    ... i'll give it a try and re-code the connection to just initialize at the ... memory which gets low, not storage memory. ... I have everything installed the latest version (sql server 2005 compact ...
    (microsoft.public.dotnet.framework.compactframework)