Write variable from other function

Suliman evermind at live.ru
Fri Feb 28 10:11:58 PST 2014


On Friday, 28 February 2014 at 16:26:17 UTC, Dicebot wrote:
> On Friday, 28 February 2014 at 16:16:36 UTC, Suliman wrote:
>> Thanks! I know about static, but now I need experience to work 
>> with class constructor. So now I can't understand what I can 
>> do with error: "Error: need 'this' for 'isConfigExist' of type 
>> 'bool()'"
>
> Most likely you don't create an instance. This works:
>
> http://dpaste.dzfl.pl/7c6ada9056ea

Big thanks! That's work!

What is the way to get from function 2 return value? For example 
I need get true or false and string value (to use it in another 
function).

	bool isConfigExist()

		{
			configpath = exePath() ~ "config.txt";
			if (exists(configpath))
				{
				return true;	
				}
				
			else
			return false;

		}

Now function return only bool and I need to make it's universal  
to get text also


More information about the Digitalmars-d-learn mailing list