You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

File Object Scope - i declare it as global but second section fails, can i do this

2 replies [Last post]
Guest's picture
Guest

Can i do this?
i declare a global thinking it would be valid for all of the program, but it fails:

Global File &LogFileA05;
Global File &LogFileA10;

/***** Set the Log File *****/
&LogFileA05 = GetFile("C:\temp\DELETE_USER_PROFILE_A05.log", "w", "a", %FilePath_Absolute);
&LogFileA05.WriteLine("Begin: " | %Datetime);
&LogFileA10 = GetFile("C:\temp\DELETE_USER_PROFILE_A10.log", "w", "a", %FilePath_Absolute);
&LogFileA10.WriteLine("Begin: " | %Datetime);

writeln in later section fails

Lepa's picture
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 06/23/2008
Posts: 565
Re: File Object Scope - i declare it as global but second ...

Do you have them declared again in the "later" section?

Global File &LogFileA05;
Global File &LogFileA10;

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

bosmanjc's picture
User offline. Last seen 1 year 15 weeks ago. Offline
Joined: 07/23/2010
Posts: 14
Re: File Object Scope - i declare it as global but second ...

thx that helped

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
The question below is to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.