0

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";
}
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Lukezzz
1

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 by hag++: n/a

0

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.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.