Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Cobol > Re: Did I write...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 10 Topic 4076 of 4195
Post > Topic >>

Re: Did I write a good (efficient) program?

by Robert <no@[EMAIL PROTECTED] > Apr 2, 2008 at 02:37 AM

On Wed, 02 Apr 2008 05:41:02 GMT, "William M. Klein"
<wmklein@[EMAIL PROTECTED]
> wrote:

>It does have a "limit" - but it still needs to "move" the following data.
 (Of 
>course in Standard COBOL there can't be data following an ODO). "for
contiguity" 
>of items, see,
>
>"8.5.1.8.1 Contiguity of data items
>A variable-length data item may be part of any group structure, and its 
>neighbors may be non-variable-length data
>items or variable-length data items. A variable-length data item is
logically 
>but not necessarily physically
>contiguous with its neighbors. However a variable-length data item
behaves in 
>all respects as though it were in fact
>contiguous with its neighbors whenever a procedural operation is applied
to a 
>group containing it."
>
>In other words, no matter how direct items are stored, if you process the
"group 
>item" containing them, it must "appear" as if the following items are
directly 
>after the current length - not after the MAXIMUM length.

The next paragraph seems to confirm that, when it qualifies any-length
with indirect. The
implication is that a change to a direct any-length item DOES affect the
addresses of its
neighbors. 

"The physical address of a variable-length data item may change during
execution of the
program. Dynamic-capacity tables and indirect any-length elementary items,
however they
may change during execution, do not in any way affect the addresses of
their neighbors."

What procedural operations are they referring to? A MOVE and comparison
would work if the
maximum length were allocated and following items not ****fted. I can think
of two
situations where it matters. FUNCTION LENGTH says nothing about
variable-length groups,
which seems like an error.  Reference modification cannot be used on
variable-length
groups. 

How can a program tell whether the item following an any-length elementary
item is
contiguous? What behavior would be different?

Suppose program A calls B with the address of an indirect any-length item
or
variable-length group containing a direct any-length item. B changes the
item's size and
address. How does A know the new address? The parameter passed was the
address of the item
or group, not the address of its base pointer. If a Cobol program did pass
the addess of
the base pointer, which it would almost have to, that would cause problems
for other
languages, including the OS API.
 




 10 Posts in Topic:
Re: Did I write a good (efficient) program?
"Frank Swarbrick&quo  2008-04-01 13:04:26 
Re: Did I write a good (efficient) program?
"William M. Klein&qu  2008-04-02 02:54:19 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-04-01 23:41:08 
Re: Did I write a good (efficient) program?
"William M. Klein&qu  2008-04-02 05:41:02 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-04-02 02:37:28 
Re: Did I write a good (efficient) program?
"William M. Klein&qu  2008-04-02 21:37:18 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-04-02 19:55:41 
Re: Did I write a good (efficient) program?
"Frank Swarbrick&quo  2008-04-03 18:31:09 
Re: Did I write a good (efficient) program?
Robert <no@[EMAIL PROT  2008-04-03 23:38:14 
Re: Did I write a good (efficient) program?
"Frank Swarbrick&quo  2008-04-04 16:49:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:08:35 CDT 2008.