I have a method which returns 1 or 0 after some transactions. I wonder if there is a way to return 1 or 0 before the transactions? The reason is because there is a mechanism that waits for this return value and it is more important than the transaction itself.
best Regards.
Keep your friends close and your enemies even closer
cenk1536
Contributor
2503 Points
2118 Posts
How to Return before execution?
Mar 13, 2012 01:36 PM|LINK
Hi,
I have a method which returns 1 or 0 after some transactions. I wonder if there is a way to return 1 or 0 before the transactions? The reason is because there is a mechanism that waits for this return value and it is more important than the transaction itself.
best Regards.
b471code3
Star
13877 Points
2598 Posts
Re: How to Return before execution?
Mar 13, 2012 01:39 PM|LINK
In your if statement try to use return; Return will exit the method at that point without running any more code.
bool isTrue = false; if (1 == 1) { if (2+1 == 3) { isTrue = true; } return; } else { isTrue = false; }cenk1536
Contributor
2503 Points
2118 Posts
Re: How to Return before execution?
Mar 13, 2012 02:04 PM|LINK
Hi,
I am sorry but I did not understand what you mean?
This is my sample method:
Public Function retDrawProgram(ByVal dsDrawProgram As System.Data.DataSet, ByVal sDrawNumber As String, ByVal sDataRevision As String) As String
//Here is my transactions
Return 1
End Function
How can I return 1 before transactions?
DMW
All-Star
15943 Points
2353 Posts
Re: How to Return before execution?
Mar 14, 2012 10:22 AM|LINK
You will need to do some asynchronous programming if you the method to return a value prior to the transactions being done.
Google/Bing on Task(Of T) for a mechanism that can do this.
Dave