× 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.



Hi Mike,

It is possible to have the fields in a prototype based on an external 
definition but it is a little "clunky".

Assuming that all of your fields are defined in a field reference file (FLDREF) 
and that all of your prototypes are defined in a single copy member (which is 
what you should be doing <g>), the prototype copy member would look something 
like this:-

     D Ref           E Ds                  ExtName(FLDREF)
     D                                     Qualified
     D                                     Based(DummyPtr)
                          
     D MyProc          PR                  ExtProc('WhatEver')
     D  Customer                           Like(Ref.CusNum)
     D  Name                               Like(Ref.Name)

The Ref DS is qualified so you do not get name conflicts and it is based on a 
pointer which is never assigned a value, so the DS neverr occupies any space.

This is just to give you the general idea. I usually have the definition of the 
REF DS in a seperate copy member along with the definition of a whole host of 
standard DSs and Named constants and it is /COPY ed in every program along with 
the member for prototypes.

HTH

Paul



----- Original Message ----- 
From: "Mike Pantzopoulos - (H/O)" <mpantzopoulos@xxxxxxxxxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, September 29, 2005 7:00 AM
Subject: Prototype Field References


I am looking for some advice concerning the use of prototypes and the
actual parameter passed via a sub-procedure:

* Our application uses an external dictionary, and only in
exceptional circumstances do we ever hard-code an attribute.
* A sub-procedure is actually a copy-book. I haven't
worked out how to define the prototype parameter as a reference to an
external data dictionary. Therefore, the field definition is whatever is
hard-coded in the parameter declaration. Is this correct, or is there
another way?
* A program which requires the prototype needs to make
sure that the parameter passed to the procedure matches the attributes
declared in the prototype. If the prototype definition changes then it
seems extremely difficult to manage the amendment of all the programs
which use the prototype/procedure.
* Because the prototype is a source file and not an
object, the D-spec declaration cannot reference the prototype
declaration and because the prototype is a source file, it cannot share
a common definition reference.

In essence, there seems to be a huge maintenance issue here.

Am I right with this assessment?

Any comments?
    
Thanks In Advance

Mike Pantzopoulos

EIG-Ansvar Limited
Tel  : 61 (3) 9614 3535
Fax: 61 (3) 9614 2740


*********************************************************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you are not the intended recipient, any use, disclosure or copying of this 
message is unauthorised. If you have received this message in error, please 
reply using the sender's email address. 

This footnote confirms that this email message has been scanned for computer 
viruses. EIG-Ansvar Limited does not accept liability for any loss or damage, 
whether caused by our own negligence or not, that results from a computer virus 
or defect in the transmission of this email or any attached file. 

EIG-Ansvar Limited - Australia (A.B.N. 21 007 216 506)
Email : insure@xxxxxxxxxxxxxxxx

Eig-Ansvar Limited - New Zealand
Email : insure@xxxxxxxxxxxxxxxx

*********************************************************************************************************

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.