- Popping empty keys is useful, to remove any trailing blank parameters, after rearranging parameters.
- Why would you rearrange parameters? For certain functions in AHK v2, the parameter order has changed.
- I'm sharing this in case anyone has interesting to add on the topic.
Code: Select all
q:: ;pop empty keys
oArray := StrSplit("a,b,c,,,", ",")
MsgBox, % oArray.Length()
JEE_ObjPopBlank(oArray)
MsgBox, % oArray.Length()
oArray := StrSplit("a,b,c,,,", ",")
oArray.10 := ""
MsgBox, % oArray.Length()
JEE_ObjPopBlank(oArray)
MsgBox, % oArray.Length()
oArray := ""
return
JEE_ObjPopBlank(oArray)
{
Loop, % oArray.Length()
{
if (oArray[oArray.Length()] = "")
oArray.Pop()
else
break
}
}