A [v0.7.5]

作者: DerRaphael 最近更新时间: 不存在


Work with an array structure with one Variable only. With these functions Array handling is similiar to real arrays. The content of the variable will be parsed.

A_Array(byRef Array)
A_ArrayMM(&tmpArray, &Array, aSize)
A_Count(byRef Array)
A_Del(ByRef Array, Item=-1)
A_Dump(ByRef Array)
A_Explode(ByRef Array, dString, sString, Limit=0, trimChars="", trimCharsIsRegEx=False, dStringIsRegEx=False)
A_Get(ByRef Array, Index)
A_Implode(ByRef Array, glue=" ")
A_Init(Array)
A_Length(ByRef Array)
A_Merge(Byref Array, ByRef sArray)
A_Pop(ByRef Array)
A_Put(ByRef Array, ByRef Data, Index=-1, dSize=-1)
A_Shift(ByRef Array)
A_Size(ByRef Array)
A_Slice(ByRef Array, ByRef sArray, Start, End)
A_Swap(ByRef Array, IdxA, IdxB)

关于函数的参数和返回值, 请参阅其源码或 此文档.

备注

The documentation is copied part from first post of DerRaphael from the discussion thread.

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?t=36600

许可

此函数(集)是基于 EUPL 许可的开源项目. 想了解许可详情, 请参见 EUPL-EN.txt

示例

; #Include a.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

Loop, 5 ; Add 5 elements to Array
{
   VarSetCapacity(t,5,asc("0")+A_Index)
   A_Put(MyArray,t)
}
Data := "1234567890abcdefghijklmnopqrstuvwxyz"
A_Put(MyArray, Data, 5) ; Change fifth entry in variable.
MsgBox, , Array Dump, % A_Dump(MyArray)
Loop, 5 ; Retrieve all elements via loop
{
   ArrayElements .= "ArrayElement #" A_Index ": " . A_Get(MyArray,A_Index) "`n"
}
MsgBox, , Via Loop retrieved, %ArrayElements%