Reusing a procedure lib by another procedure lib

Posted by Kai Siegele on 13-Oct-2017 07:29

Hallo,

I have created a procedure lib with some base functions (calling BaseTools.pl). Now I have created another procedure lib Formtools.pl that should use the functions of this base procedure lib.

For that purpose

* I have copied the base procedure lib into the directory of Formtools.pl.

* I have started proenv and have switched into this directory.

* I have added the base procedure lib with command prolib FormTools.pl –add BaseTools.pl.

* I have checked the result of adding with command prolib FormTools.pl –list. Everything looks well.

Now I want to use the procedure lib Formtools.pl and its underlying base procedure lib in a client application.

* I have added procedure lib FormTools.pl to the PROPATH-variable.

* I have compliled the client applcation without getting errors. Everything still looks well.

When starting the client application the functions of FormTools.pl are invoked correct. But I got an error when the functions of FormTools.pl try to invoke functions of base procedure lib. Has anyone an idea why? And how to avoid this error?

Kind regards

Kai Siegele

Posted by Kai Siegele on 16-Oct-2017 08:21

Hallo Brian,

thanks for your answer.

Perhaps my description was a little bit confusing: I have added the whole pl file. I don’t want to insert the r-files, being part of my lib. User of my lib need not to know them. After I have extended the functionality user should just replace the lib.

And my question is: Is there a way to combine procedure libs?

Kind regards

Kai Siegele

All Replies

Posted by Brian K. Maher on 13-Oct-2017 07:46

so you have one combined .pl file on the propath, right?
 
do a prolib -list and verify that the relative path to the .r matches your source code calls into it.

Posted by VikasDugar on 13-Oct-2017 11:10

Can you post the error message. 

Posted by Richard.Kelters on 14-Oct-2017 04:31

I believe it is not possible to add a procedure library to another library, well you can but it will not work. You have to add the functions from both libraries in one library or keep them as separate libraries and add both to your propath.

Posted by Kai Siegele on 16-Oct-2017 08:21

Hallo Brian,

thanks for your answer.

Perhaps my description was a little bit confusing: I have added the whole pl file. I don’t want to insert the r-files, being part of my lib. User of my lib need not to know them. After I have extended the functionality user should just replace the lib.

And my question is: Is there a way to combine procedure libs?

Kind regards

Kai Siegele

Posted by Brian K. Maher on 16-Oct-2017 08:30

Kai,
 
That won’t work.  You can’t nest .pl files inside of other .pl files and expect it to work.
 
Either merge the contents of the two .pl files together or just add both to the propath.
 
Brian
 

Posted by Kai Siegele on 16-Oct-2017 09:16

Hallo Brian, hallo Richard, hallo Vikas,

Thanks for your help.

It’s a pity that it’s not possible to combine procedure libs. In my opinion such a feature would help to make procedure libs much more resuable such like dll’s in C++ or C#.

Best regards

Kai Siegele

Posted by Brian K. Maher on 16-Oct-2017 10:50

Look into the OO functionality the language exposes

This thread is closed