|
|
Re: add certain files to global scope [message #1711280 is a reply to message #1711197] |
Wed, 14 October 2015 14:21 |
Eleanor Richie Messages: 125 Registered: August 2014 |
Senior Member |
|
|
Hi Chris,
file1 can't see file4 because each file is in a different package.
I want them to see each other (i.e we can reference objects from file1 in file4) when I write in file4 a statement that allows files in a specific package to be accessible.
For example
File1 in package = pack1:
{
integer f1 = 10;
function foo (parameters: integer i, j){
i ++;
j= j+2;
}
}
--------------------------------------------------------------------
File4 in package= pack2 (Now it can't see ANYtHING in file1):
{
integer f2=0;
integer f3= 4;
f2 = foo(f2,f3); // ------------> This should give an error bec. foo is in file file1 in another package that is not accessible.
}
-------------------------------------------------------------------------
Now I will modify file4 to make ALL the files in pack1 to be accessible
File4 in package = pack2 will be like this:
{
Add Package pack1; //This will make files in pack1 accessible in pack2
integer f2=0;
integer f3= 4;
f2 = foo(f2,f3); //This will not give an error now
}
[Updated on: Wed, 14 October 2015 14:30] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04127 seconds