|
Hello Nelson, You wrote: >If I have duplicate procedure names, both in my local modules and/or in >service programs that are in my binding directory, and use *DUPPROC on my >compile commands, what method does the compiler use to determine which >version of a proc it uses? The order that they are listed on the binding >directory? Do local procedures take precedent over a service program >procedure of the same name? Is there anyway to qualify a procedure call? >Is it a set method that can be counted on to repeat each time, or is it >unpredictable? The ILE Concepts manual seems pretty vague on this. Perhaps, but the help text is not so vague: " *DUPPROC During the symbol resolution phase of the binding process, the procedure names that are exported from the modules and service programs do not have to be unique. When multiple duplicate procedures are allowed, the first exported procedure in the list of specified modules and service programs that matches the import request is the procedure that is selected. " The binder simply takes the first reference found. That means it looks at the list of modules on the MODULE keyword, then it looks at the service programs listed on the BNDSRVPGM keyword, then it uses the contents of the binding directories, in order, listed on the BNDDIR keyword. It doesn't care if a procedure is bound by copy or bound by reference. For example, if you have a procedure called doStuff in module X and also in service program Y then Y.doStuff will be used if Y is listed in the binding directory before X. Simple but crap! Until support is provided for qualified or overloaded procedure calls you should not be using duplicate exported procedure names nor duplicate variable exports if you can avoid it. One way to achieve the effect of overloaded or qualified procedure calls is to get a list of the exported procedures in the service programs (QBNLSPGM format SPGL0600), activate service programs yourself (QleActBndPgm), get pointers to the exported proceures (QleGetExp), and call the procedures via the function pointer. Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.