Thread overview
undefined identifier doesn't make sense
May 21, 2013
Enjoys Math
May 21, 2013
Anthony Goins
May 21, 2013
Enjoys Math
May 21, 2013
Enjoys Math
May 21, 2013
evilrat
May 21, 2013
Here's Gui.d:

module Gui;

private import gtk.MainWindow;

private import ProjectFile;

// @@TODO: remove
private import gtk.Label;

class Gui : MainWindow
{
private:
	ProjectFile* proj;

public:
	this() {
		super("Our Audio Synth App");
		
		proj = ProjectFile.loadLastProjectOrNew();
		
		setDefaultSize(600, 400);	// @@TODO: default size should be loaded from last user-defined
		maximize();		// Maximize window if available
		
		add(new Label("epic lulz"));
		showAll();
	}

	~this() {

		// @@ TODO
		// If AppSettings dir DNE
			// Create AppSettings dir

		// Save AppSettings file

	}
}


Here's ProjectFile.d:

module ProjectFile;

private import std.stdio;

struct ProjectFile
{
private:
	struct GuiSettings
	{
		// Main window settings
		uint winPosX, winPosY;
		uint winWidth, winHeight;
	}

public:
	GuiSettings gui;
	

	static ProjectFile* loadLastProjectOrNew()
	{
		// if LastProject.txt exits
		   // open LastProject.txt and read the first line
		   // try opening the file with that path & name
				// if success convert the data into a Project file object and return it
		// create new ProjectFile using default constructor and return
		
		auto lastProjectDotTxt = new File("LastProject.txt");
		
		return new ProjectFile;
	}
}

The error is:

Building Debug\TheApp.exe...
Gui.d(19): Error: undefined identifier 'loadLastProjectOrNew'

Doesn't make any sense.
May 21, 2013
??
ProjectFile.ProjectFile.loadLastProjectOrNew()
??
maybe.
May 21, 2013
On Tuesday, 21 May 2013 at 03:15:46 UTC, Anthony Goins wrote:
>
> ??
> ProjectFile.ProjectFile.loadLastProjectOrNew()
> ??
> maybe.

That did it!!!  Lol crazy. :D  Thx
May 21, 2013
Should I put my static methods at module scope then?
May 21, 2013
On Tuesday, 21 May 2013 at 04:17:26 UTC, Enjoys Math wrote:
> Should I put my static methods at module scope then?

just don't give symbol(struct/class/function/variable) names same as module