배열은 컬렉션과 다르다!

배열은 정해진 메모리 크기에 불가변한 데이터를 넣는다. 삭제와 추가가 불가능하다. 데이터는 순서대로 처리한다.

그런데 컬렉션은 각 메모리에 주소가 있어서 주소를 이동하면서 데이터를 처리한다. 가변하기 때문에 데이터의 삭제와 추가 및 변경이 가능하다. 그래서 변하지 않는 데이터를 이용할때는 배열에 넣고, 가변하는 데이터는 컬렉션에 넣는다.

 

 

변수의 초기화

먼저, 컬렉션과 배열은 가급적 초반에 초기화해주는 것이 정신건강에 좋다. 왜냐하면 이것저것 작업하고나서 실행하려니까 안된다고 하는데, 대부분의 이유가 지정 범위를 벗어났던가 아님 초기화를 안해줘서 그렇다.

collection과 관련된 액티비티

 

다음 액티비티들은 UiPath에서 쉽게 찾아볼 수 있는 컬렉션 관련 액티비티들이다.

이러한 액티비티들을 사용하기 위해서는 초기화가 반드시!! 필요하다. 

(흔히 사용하는 DT 의 액티비티들도 초기화가 필수이다 !! )

변수타입 초기화 예시
 List  new List(Of 타입) from {값} new List(Of String) from {"가"}
 Array  new 타입(item개수) {값} new String(2) from {"가", "나"}
 Dictionary  new Dictionary(Of 타입, Of 타입) from {{값, 값}} new Dictionary(Of String, String)
                         from {{"가", "나"}, {"다", "라"}}

 

 

 

* 참고 주소

- https://www.edureka.co/community/41105/how-to-loop-through-a-dictionary-in-uipath

 

How to loop through a dictionary in UiPath?

I want to know how can I loop through a dictionary in UiPath?

www.edureka.co

- https://excelcult.com/2019/07/19/how-to-define-dictionary-add-items-to-dictionary-and-access-items-from-dictionary-in-uipath/

 

How To Define Dictionary, Add Items To Dictionary and Access Items From Dictionary - In UiPath - ExcelCult

What is a Dictionary? In general, a Dictionary is a collection of words and their…

excelcult.com

- https://forum.uipath.com/t/how-to-loop-through-dictionary/12243

 

How to loop through Dictionary?

how to Read data from dictionary which I have initialized like variable1= new Dictionary(Of String, String)From {{“0”, “string”}, {“1”, “string2”}}

forum.uipath.com

- https://forum.uipath.com/t/initialize-array-of-list/110770

 

Initialize Array of List

Hello, I have 4 lists and I want to put them into an Array. I am curious how can I initialize this new Array of Lists? I have assigned the lists to the array but what is the syntax to a new array of list? For Array, new String(4){} For List, new List(Of St

forum.uipath.com

 

 

+ Recent posts