What will happen in the next situation
There is a Zclass.cls in package X and in package Y (Zclass in Y inherits form Zclass in X)
In my code i have
USING X.*.
USING Y.*.
MyClass = NEW ZClass().
Which class wil be Myclass? The one from package X or package Y ? And why ? Is the order of USING important ?
I have read the documentation about this but i cannot get it:
![]() |
![]() |
![]() |
![]() |
some more specific: i want to be able to trust the using statement order to find the right class !
file and directory structure:
Src/Datamex/Progress/CRM/UI/UIInputBox.cls
Src/Datamex/Progress/DORA/UI/UIInputBox.cls
Src/Datamex/Progress/Trade/UI/UIInputBox.cls
PROPATH is Src.
code:
USING Datamex.Progress.Trade.UI.*.
USING Datamex.Progress.Crm.UI.*.
USING Datamex.Progress.DORA.UI.*.
DEF VAR clsTest AS UIInputBox.
clsTest = NEW UIInputBox("1", "2", "3", "4", "5") .
MESSAGE "VERSION:" clsTest:ToString() VIEW-AS ALERT-BOX INFO.
Is this the right way; does Progress look for classes in the USING statement order ?
The Compiler looks for classes in the USING statement order with the caveats noted below:
The following steps are taken by the Compiler to resolve an unqualified type name:
• Compare the unqualified name against the last node of each <type-name> specified in a USING statement in the order of the USING statements. If the names are equal, we have a match. The compiler then checks to make sure the type exists on PROPATH. If it doesn’t, there is an error.
• If not yet resolved, replace the “*” of each package.*, in the order of the USING statements, with the unqualified name. Check the resulting partially qualified file name to see if type exists on PROPATH. If so, we have a match.
If you have source code for the modules in question, there would be a ***lot*** to be said for *not* using a naming convention that fostered this kind of potential confusion. It assumes a ***lot*** on the part of the reader.