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 4 weeks 3 days ago. Offline
Joined: 06/23/2008
Posts: 591
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 7 years 48 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

CAPTCHA
The question below is to prevent automated spam submissions.
8 + 10 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.