Call .cls from other file

balta

Member
Hello,

i am trying to call a "shared" cls file from a main file.

The class

1590402810522.png

I am call doing this.

1590402859093.png

Can help?

Thanks,
Baltazar
 

Stefan

Well-Known Member
Looks like you need to first fix the compile error on your base.cls before attempting to use it.
 

Stefan

Well-Known Member
An unqualified class name in a USING statement is not appropriate. Specify a qualified class name or <package>.*. (13681)

The USING statement is used so that code can specify an unqualified class name to reference a qualified class. It tells the compiler what package to find the unqualified class name reference in. For example, USING acme.bar.
myacme = NEW acme(). /* creates a new acme.bar class instance */
Specifying an unqualified name in the USING statement itself does not have any affect on your code and is therefore not appropriate.
 

tamhas

ProgressTalk.com Sponsor
It is very unclear what you are trying to do or expecting to happen. As Stefan said the USING statement has no function than to allow the use of an unqualified class name in the remaining body of the class. I.e., being able to reference just "base" instead of "ProcedureLibraries.base". Actually using the class depends on what you want to do with it. Given that the current example merely defines a variable, has no assignments to or from that variable, and has no methods, it is unclear what such use would be.

Incidentally, while you don't say what your PROPATH is (which is relevant since USING statements are PROPATH relative), one guesses that ProcedureLibraries is on your PROPATH. This would mean no USING statement was required at all. Moreover, it is very bad practice since you will soon have a zillion loosely related files in one directory. I tend to use Module/Function so that, for example, an invoice copy class might be in AR/Invoice/InvoiceCopy.cls. It could then be referenced elsewhere by AR.Invoice.InvoiceCopy or with USING AR.Invoice then just InvoiceCopy.
 

balta

Member
Thanks for your input! At this moment I am doing tests how net works...

If you could send recommend code, I appreciate.
 
Top