I have created a process using language as ‘C#’. In the workflow i have assigned boolResult = int.TryParse(“45”, out intResult). Here boolResult is the bool type variable and intResult is the int type variable. When i try to print intResult in the Log activity, the output i am getting is 0 not 45.Pls find attached below image
Same expression in visual studio is working fine
in ‘io’ variable i am getting the correct output which is 45.
Thanks in advance
when using the Assign Activity the parsed value is not forwarded to the out variable.
We can use the invoke method activity instead for this method call
Thanks for the reply.
I tried to use the invoke method but getting below error
Target type will accept ‘struct’ in this case? please find screenshot of the tryparse method signature and its struct
Instead of using
use this Expression to get better
Assign intResult = CInt(“45”)
Why are you trying to assign the result to a boolean?
Bingo It works!!! Thanks for the solution
I don’t see any difference. Both pointing to the same TryParse method in the C# library.Please correct me if i am wrong
Its C# tryparse method, which gives ‘True’ if the input value is int otherwise false without throwing any error, at the same time it will give the value itself in another variable.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.