4d3f5603创建于 2016年3月22日历史提交
[PMC Code v5.0.0]|F1||1|Window,2,Fast,0,1|1|Arrays1
Groups=Start:1
1|[Assign Variable]|N := [10, 20, 30]|1|0|Variable|Expression||||
02|Array|N := 10, 20, 30|1|0|Function|||Alternative way to assign arrays||
3|[LoopStart]|LoopStart|% N.Length()|0|Loop|||||
4|[MsgBox]|% N[A_Index]|1|0|MsgBox|262144||||
5|[LoopEnd]|LoopEnd|1|0|Loop|||||
6|[Assign Variable]|N[4] := New value|1|0|Variable|||||
7|[MsgBox]|% "N[4]: " N[4]|1|0|MsgBox|262144||||
8|Sqrt|FuncOut := N.1|1|0|Function|||||
9|[MsgBox]|Sqr Function with Array parameter: %FuncOut%|1|0|MsgBox|262144||||

[PMC Code v5.0.0]|F2||1|Window,2,Fast,0,1|1|Arrays2
Groups=Start:1
1|[Assign Variable]|String := ABCDE|1|0|Variable|||||
2|StrSplit|MyArray := String, ""|1|0|Function|||||
3|[LoopStart]|LoopStart|% MyArray.MaxIndex()|0|Loop|||||
4|[Assign Variable]|ArO := MyArray[A_Index]|1|0|Variable|Expression||||
5|[MsgBox]|Loop: %A_Index%`nMyArray[%A_Index%]: %ArO%|1|0|MsgBox|262144||||
6|[LoopEnd]|LoopEnd|1|0|Loop|||||

[PMC Code v5.0.0]|F3||1|Window,2,Fast,0,1|1|ForLoop
Groups=Start:1
1|[Assign Variable]|MyVar := This is a variable!|1|0|Variable|||||
2|[Assign Variable]|MyArray := ["a","b","c",MyVar,"d","e"]|1|0|Variable|Expression||||
3|[LoopStart]|MyArray`, key`, value|1|0|For|||||
4|[MsgBox]|%key% : %value%|1|0|MsgBox|262144||||
5|[LoopEnd]|LoopEnd|1|0|Loop|||||

[PMC Code v5.0.0]|F4||1|Window,2,Fast,0,1|1|MultiDim
Groups=Start:1
1|[Assign Variable]|N := ["Item 1"]|1|0|Variable|Expression||||
2|[MsgBox]|% N[1]|1|0|MsgBox|262144||||
3|[Assign Variable]|N[2] := []|1|0|Variable|Expression||||
4|[Assign Variable]|N[2][1] := Item 2.1: Multi dimensional array value.|1|0|Variable|||||
5|[MsgBox]|% N[2][1]|1|0|MsgBox|262144||||
6|Asc|N[2][2] := "A"|1|0|Function|||||
7|[Assign Variable]|ItemCopy := N[2][2]|1|0|Variable|Expression||||
8|[MsgBox]|Item 2.2: %ItemCopy%|1|0|MsgBox|262144||||
9|Push|_null := "Item 2.3"|1|0|Method|N.2||||
10|[MsgBox]|% N.2.3|1|0|MsgBox|262144||||

[PMC Code v5.0.0]|F5||1|Window,2,Fast,0,1|1|Methods
Groups=Start:1
1|[Assign Variable]|Values := |1|0|Variable|||||
2|[Assign Variable]|N := []|1|0|Variable|Expression||||
3|Push|_null := "A", "B", "D"|1|0|Method|N||||
4|[LoopStart]|N`, each`, value|1|0|For|||||
5|[Assign Variable]|Values .= %value%`, |1|0|Variable|||||
6|[LoopEnd]|LoopEnd|1|0|Loop|||||
7|[MsgBox]|%Values%|1|0|MsgBox|262144||||
8|InsertAt|_null := 3, "C"|1|0|Method|N||||
9|[Assign Variable]|Values := |1|0|Variable|||||
10|[LoopStart]|N`, each`, value|1|0|For|||||
11|[Assign Variable]|Values .= %value%`, |1|0|Variable|||||
12|[LoopEnd]|LoopEnd|1|0|Loop|||||
13|[MsgBox]|%Values%|1|0|MsgBox|262144||||

[PMC Code v5.0.0]|F6||1|Window,2,Fast,0,1|1|NamedKeys
Groups=Start:1
1|Object|N := |1|0|Function|||||
2|[Assign Variable]|N.keyA := Value of KeyA|1|0|Variable|||||
3|[MsgBox]|% N.keyA|1|0|MsgBox|0||||
4|[Assign Variable]|N["keyB"] := Value of KeyB|1|0|Variable|||||
5|[Assign Variable]|N["keyC"] := Value of keyC|1|0|Variable|||||
6|[Assign Variable]|N["keyC"] .= N["keyA"]|1|0|Variable|Expression||||
7|[LoopStart]|N`, each`, value|1|0|For|||||
8|[MsgBox]|%each%: %value%|1|0|MsgBox|262144||||
9|[LoopEnd]|LoopEnd|1|0|Loop|||||

[PMC Code v5.0.0]|F7||1|Window,2,Fast,0,1|1|AssociativeArray
Groups=Start:1
1|[Assign Variable]|person := {name: "John", surname: "Smith", age: 26, stats: [10,9,8.5,7,9.5,10]}|1|0|Variable|Expression||||
2|[LoopStart]|person`, key`, value|1|0|For|||||
3|[MsgBox]|%key%: %value%|1|0|MsgBox|0||||
4|[LoopStart]|value`, key`, value|1|0|For|||||
5|[MsgBox]|%key%: %value%|1|0|MsgBox|0||||
6|[LoopEnd]|LoopEnd|1|0|Loop|||||
7|[LoopEnd]|LoopEnd|1|0|Loop|||||