在List<T>中增加元素

这可能不是关于UiPath的问题,而是关于VB的简单问题。
我想将日期或字符串加入到一个空列表中,我设置了列表的类型是System.Collections.Generic.List<System.DateTime>以及System.Collections.Generic.List<String>,然后用assign中用Date_List = Date.List.Add(StartDate),但是提示错误“表达式不产生值"。
image
image
image

请问应该怎么写?谢谢。

Hi,

Unfortunately, Assign activity doesn’t support void method.
Can you try Invoke Method as the following?

Regards,

Thank you for your prompt reply. It worked. :grinning:

But I still have question about in which scenario shall we Invoke Method activity. Is this activity used to invoke a existed method in VB but not involved in UiPath?

Hi,

Invoke method can call any method for not only class of vb but also any other class including UiPath.

Regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.