How to create instance of class that get data from 2 another instance?

Tobias Pankrath via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 2 06:37:55 PST 2015


On Friday, 2 January 2015 at 11:21:08 UTC, Suliman wrote:
> I looked at my code and it's seems that I can create instance 
> of MySQL in main.
>
> void main()
> {
> auto parseconfig = new parseConfig();
> auto mysql = new MySQL(parseconfig, seismodownload);
> }
>
> In parseConfig I am creation instance of seismoDownload:
>
> class parseConfig
> {
> ....
> if (checkLinkCode(emsc_csem) == 200)
> {
> auto seismodownload = new seismoDownload(emsc_csem);
> seismodownload.parse();
> }
> ....
> }
>
> So I should be able to call it in main ( I talk about "auto 
> mysql = new MySQL(parseconfig, seismodownload);")
>
>
> But I am getting error:
> Error: undefined identifier seismodownload, did you mean class  
> seismoDownload?

Anything declared in main() is local to main and not a global.


More information about the Digitalmars-d-learn mailing list