What is best way to get see function from separate file

Jonathan Villa via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 10 11:39:06 PDT 2016


On Sunday, 10 April 2016 at 18:36:19 UTC, Jonathan Villa wrote:
> On Sunday, 10 April 2016 at 18:26:57 UTC, Suliman wrote:
>
> Other whay is to leave FileLogger instance in a separated 
> module:
> logger.d
> public static FileLogger fLogger;
>
> App.d
> import logger; //the module
> void main()
> {
>     // generate instance
>     logger = new FileLogger("ErrorLog.txt");
> }
>
> utils.d
> import logger; // the module
>
> foo ()
> {
>     fLogger...
> }
>
> I cannot think in other ways.
>
> JV

FIXING MAIN()
void main()
{
     // generate instance
     fLogger = new FileLogger("ErrorLog.txt");
}




More information about the Digitalmars-d-learn mailing list