Search code examples
c#uipath-studio

UiPath: How to set default values to a String[] variable


I have an exception when I'm trying to launch my workflow. It cames from my array declaration where I apparently don't have the right syntax.

My syntax really looks like the one used in the UiPath tuto I follow :

The tuto syntax: The array from the tuto

My syntax: My array

I don't understand how I'm supposed to write the default values for a simple array of strings...

I'm only trying to pass the values in a Write Line activity, but this shows up when compiling: exception

If anyone can help, I'm stuck... Thanks

--- EDIT ---

The exception message is the following one:

Message: Compilation failure:

; expected Unvalid expression terms ',' ... many times...

The full results are stored in the Data property of this exception. Correct the errors of the source, then retry the load.


Solution

  • I found the problem: I did not instantiate the array with new String[] at the beginning. I suppose that the tutos are written using VB and not C#, which can explain the difference.