Question: Normally, in Invoke Code, an inArgument
would pass the variable into the Invoke Code Container. If we change the value inside the Invoke Code, it should not affect the original value outside Invoke Code. However, this is not the case for DataTable variables. Why?
Answer:
- Variable Behavior in akaBot:
- In akaBot, variables are .NET types. The behavior of variables when passed as arguments (InvokeCode, InvokeWorkflowFile) follows Microsoft .NET specifications.
- Basic Types:
- Basic types like Integer, Strings, Boolean, DateTime, etc., will not have their values changed outside of InvokeCode if specified with the
[In]
direction. - However, if these basic types are used as arguments with the
[In/Out]
direction, their values will change.
- Basic types like Integer, Strings, Boolean, DateTime, etc., will not have their values changed outside of InvokeCode if specified with the
- Complex Types (e.g., DataTable):
- For complex types like DataTable, the value outside of InvokeCode will change if modified inside InvokeCode, regardless of the argument direction specified.
- Reference for More Information:
- For more detailed information on .NET variable handling and specifications, please refer to the Microsoft documentation: Data Types in .NET
By understanding these behaviors, you can better manage variable values and their changes when using Invoke Code in akaBot.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article