Get invoked Progress procedure .p file location at runtime

82 Views Asked by At

Lets say I have a simple procedure file in my system:

C:\git\project\helloworld.p

Inside this procedure file, the code needs to know it's location on my system at runtime. So in my computer in this case it would be:

C:\git\project\helloworld.p

In my friend's computer it could be:

D:\codingprojects\project\helloworld.p

Is there any way to resolve the procedure file location at runtime?

2

There are 2 best solutions below

0
Mike Fechner On BEST ANSWER
FILE-INFO:FILE-NAME = THIS-PROCEDURE:FILE-NAME.
MESSAGE FILE-INFO:FULL-PATHNAME. 
1
Stefan Drissen On

Why is the location relevant? Your code should never be using absolute paths, but only using:

run helloworld.p

Your working directory should be c:\git\project with a propath containing a . entry indicating look in the working directory.