× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



David,

Could someone explain the last definition? If I were to pass myzone by
reference to a procedure, it's the packed version that gets passed. How
should I pass this zone?


The definition of a field in an externally described file is its format in
that file. If the field is not also named in a data structure or
stand-alone D spec, then the compiler may use a different format for the
field. In general, both packed and zones fields will be stored internally
as packed. One reason it does this is, at least on the CISC boxes, I
believe performance of the arithmetic operations was better when both
operands were packed. But aside from performance, consider what happens
when the same field name exists in multiple files used by a program. As
long as the number of digits and decimal positions is the same in each file,
you can do that even when some files declare it as zoned and others as
packed. The reason that works is the field is moved from its external
definition to the program variable assigned to hold that value, and that
program variable is packed.

In order to force a program variable to be a particular format, name it on a
D spec and signify the type, or include the variable in a data structure.
An easy way to do the later is to use an externally described DS based on
the file you are using. This forces each of the fields in the program to
use the same format as the external definition. Note however that if
multiple files have the same field name, you can't have that name appear in
multiple data structures because the program variable must exist in only one
memory location.

Doug

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.