I wonder how it is possible to retreive a string from a function that is generating this string.
How is it possible to get the string "SendThis" when presssing the button1 in this case and declare it to getgenerateString ?

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) 
{
	String^ getgenerateString = ""; //How to get the string "SendThis" here ?
}

void generateString()
{
	String^ sendThisString = "SendThis";
}

What about calling the generateString function within your buttonclick function, except have generateString return the string instead of void

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) 
{
	String^ getgenerateString = generateString(); 
}

String^ generateString()
{
	String^ sendThisString = "SendThis";
         return sendThisString;
}

Edited 6 Years Ago by hag++: n/a

Yes that was a good idéa, that is working great for the purpose.

Thanks for that !

What about calling the generateString function within your buttonclick function, except have generateString return the string instead of void

private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) 
{
	String^ getgenerateString = generateString(); 
}

String^ generateString()
{
	String^ sendThisString = "SendThis";
         return sendThisString;
}
This question has already been answered. Start a new discussion instead.