You don't return value from a method to a method. You return a value to a caller, which looks like assignment operator:
SomeType someVariable = SomeMethod(someParameterValue, anotherParameterValue);
where
SomeType
is a return type of
SomeMethod
.
Another way is
out
parameters:
SomeType SomeMethod(SomeParameterType byValueParameter, out SomeOtherType byReferenceOutParameter) { }
SomeParameterType myInput =
SomeOtherType actualByReferenceOutParameter;
SomeType returnedValue = SomeMethod(myInput, out actualByReferenceOutParameter);
If looks like you need to read about C# and programming nearly from the very beginning, it can greatly help you.
Your code has too many problems. Hard-coded
immediate constants like "PT+1001", "PT+1002", 25, 2000, "Success" makes code practically unsupportable, design is very ad-hoc, instead of "",
string.Empty
should be used, too many parameters, all is public (why), no signs of OOP…
—SA