Hii
I have problem.
I have one global variable (string query_type)
now i want the hold some valu inside in one function and the i want that value in anoyher function for checkinf purpose.
How to do this pls help.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Jan 18, 2013, 12:46 AM
if you want to share data between two function, you have two way
1) use share varible.
public string query_type = string.Empty;
public void SetTypeString()
{
query_type = "now it is set";
}
public void GetTypeString()
{
string ret = query_type;
}
2) pass data as parameter to other function.
public void SetTypeString()
{
string query_type = "now it is set";
}
public void GetTypeString(string mystring)
{
string ret = mystring;
}
hope this will help you.
Pranjal MishraPosted Jan 17, 2013, 11:08 PM
Jignesh TrivediPosted Jan 17, 2013, 10:45 PM
I am not getting your que.
Correct me. you want to share some data between to function for that you global variable.
here i also some que.
Are you use window base or web base application?
kindly share more info about you problem.