오토핫키 커뮤니티

정보
2015.04.17 15:47

Array 확장

조회 수 792 추천 3 댓글 13

오토핫키의 별볼일 없는 Array를 진짜 Array처럼 확장시켜주는 소스입니다


Concat(array2,array3,...,arrayX) ? ? ? ? ?- join two or more arrays

IndexOf(Item, Start := "") ? ? ? ? ? ? ? ?- searches the array for item, front to back

Join(Sep := ",") ? ? ? ? ? ? ? ? ? ? ? ? ?- joins the elements of an array into a string

LastIndexOf(Item, Start := "") ? ? ? ? ? ?- searches the array for item, back to front

Length() ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?- returns the number of elements

Pop() ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - returns and removes last element of array

Push(item1, item2, ..., itemX) ? ? ? ? ? ?- adds new items to the end of the array

Reverse() ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - reverses the order of the elements

Shift() ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? - returns and removes first element of array

Slice(Start, End := "") ? ? ? ? ? ? ? ? ? - returns the selected elements as a new array

Sort(Options := "") ? ? ? ? ? ? ? ? ? ? ? - sorts the items of the array

Splice(Start, HowMany, item1, ..., itemX) - adds/removes items to/from the array

Unshift(item1,item2, ..., itemX) ? ? ? ? ?- adds new items to the beginning of the array

위 명령을 추가로 사용 할 수 있습니다.


소스는 아래 링크에서 체크하시고..

아래에 예제만 붙여넣기 합니다.


출처 & 소스 :?http://www.autohotkey.com/board/topic/94602-additional-methods-for-indexed-arrays/


; Autoexecute
#NoEnv
#SingleInstance force

#Include Array Extensions.ahk

none := []
hege := ["Cecilie", "Lone"]
stale := ["Emil", "Tobias", "Linus"]
kai := ["Robin", "Tobias", "Walter"]
Num := [5,3,7,9,1,13,999,-4]

children := hege.Concat(stale, kai)
MsgBox, 0, Concat Arrays Building Children, % "Children =`n" children.Join("`n")

MsgBox, 0, IndexOf Tobias, % children.IndexOf("Tobias")

MsgBox, 0, IndexOf Tobias with Start = 5, % children.IndexOf("Tobias", 5)

MsgBox, 0, LastIndexOf Tobias, % children.LastIndexOf("Tobias")

MsgBox, 0, LastIndexOf Tobias with Start = 5, % children.LastIndexOf("Tobias", 5)

MsgBox, 0, LastIndexOf Tobias with Start = 5, % children.LastIndexOf("Tobias", 5)

MsgBox, 0, Length of Children, % children.Length()

MsgBox, 0, Pop an Element, % children.Pop()

MsgBox, 0, Array After Pop, % children.Join("`n")

MsgBox, 0, Push Micheal, % children.Push("Micheal").Join("`n")

MsgBox, 0, Shift an Element, % children.Shift()

MsgBox, 0, Array After Shift, % children.Join("`n")

MsgBox, 0, Unshift George, % children.Unshift("George").Join("`n")

MsgBox, 0, Slice Out Indexes 2 - 4, % children.Slice(2, 4).Join("`n")

MsgBox, 0, Splice - 2 Elements Removed at Index 3
, % children.Splice(3, 2, "Sally", "Amy").Join("`n")

MsgBox, 0, Splice - Sally`, Amy Added at Index 3
, % children.Join("`n")

MsgBox, 0, Sort Children, % children.Sort().Join("`n")

MsgBox, 0, Numerical Sort, % Num.Sort("N").Join("`n")

MsgBox, 0, Reverse Children, % children.Reverse().Join("`n")

return






List of Articles
분류 제목 글쓴이 최근변경 추천
정보 Array 확장 13 모바게 2015.07.16 3/0
정보 [지니모션][블레이드][핸콕님매크로]+추가기능 v1.1 23 잠깐만요 2015.05.27 3/0
정보 오토핫키 미니 에디터 5 예지력1 2016.07.02 3/0
질문 매크로 제작자분들께 인증에 관한 질문드립니다. 17 모바게 2016.01.22 3/0
자유 저에게 도움주셨던 많은 분들께 인사하로 들렀습니다... 8 파더 2015.02.12 3/0
정보 GUI - 파일(폴더) 목록을 DropDownList로 만들기 14 모바게 2016.06.13 3/0
자유 세븐나이츠 매크로 만드는 중 11 보득 2015.02.25 3/0
정보 스크린샷 캡춰방법 (마지막이야기님 요청) 14 호로록뚝딱 2015.03.24 3/0
자유 쿠키런 비활성화 매크로 8 mauver 2015.03.25 3/0
자유 게임내용을 적을 때는 꼭 게임명을 제목에 적어주세요. 9 피카부 2016.06.15 3/0
자유 오핫 제작합니다 1 설입 2024.06.19 2/0
질문 핫린이 한수 여쭙습니다 ^^ 3 ddd123 2023.02.24 2/0
질문 사인코드 어떻게 뚫죠? 2 푸파재대결 2023.02.24 2/0
자유 오토핫키 우회방법 가르쳐주실분구합니다 1 고생 2023.02.24 2/0
자유 던파 매크로 구해봅니다 1 ryuhda 2022.12.14 2/0
공유 자작)매크로 제작에 유용한 툴 ImageTool for Game 14 sama 2021.04.22 2/0
공유 pc카톡 채팅자동반응(비활성) 소스입니다 16 sama 2018.11.26 2/0
자유 와...비활성 이미지서치 진짜 힘드네요;; 7 테일하는병키 2017.11.11 2/0
자유 리니지m 매크로 소스 공유합니다 28 무쏘오 2019.06.11 2/0
공유 미완성 구이 공유합니다. 5 이무 2019.11.06 2/0
Board Pagination Prev 1 2345678910 ... 209 Next
/ 209

전체 최신 인기글

전체 주간 인기글