【问题标题】:autohotkey array null... how do you check if the array is null/empty?autohotkey array null ...你如何检查数组是否为空/空?
【发布时间】:2019-09-05 00:44:20
【问题描述】:

Autohotkey 真的很痛苦,在 C# 中这个简单的东西很容易,但我无法让它与 Autohotkey .ahk 文件一起使用。

ListOfVal:=Arrays() ; Or ListOfVal:=[] | this creates the array <---comment

这个我试过了……

if ListOfVal=null                                  
    MsgBox, "testing"

;Ive tried all these too...

;if ListOfVal==null

;if ListOfVal:=null 

;if !ListOfVal

;if ListOfVal.MaxIndex()<1        

;if ListOfVal.MaxIndex()=-1

你知道我在这里拉头发,请帮忙......

【问题讨论】:

    标签: arrays null autohotkey


    【解决方案1】:

    尝试以下MinMaxIndexLengthCount 之一

    IsObject

    【讨论】:

    • 好吧,我确实得到了一些工作......它很丑陋,可能是最糟糕的编码方式,但它就是这样。以后可能会找到更好的方法。
    • ListOfVal:=[] Loop{ GotC:=ListOfVal.GetCapacity() if GetKeyState("d") { ListOfVal.Insert(80) Sleep 100 } if GetKeyState("s") { msgbox, % GotC Sleep 100 } }
    • 我刚刚发布的那段代码有效,但我没有让它看起来像那样。当我粘贴它时它是结构化的......我不知道为什么当你发布一些东西时它会像那样混杂在一起。
    • 这里有一个更好的代码 sn-p。 global ListOfVal:=[] ;type c to check Length ;type a to add to the length a:: { function(5) } c:: { function(0) } function(x) { if x&gt;0 { ListOfVal.Insert(80) }else{ GotC:=ListOfVal.Length() msgbox, %GotC% } }
    猜你喜欢
    • 2011-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    • 2012-07-02
    • 1970-01-01
    相关资源
    最近更新 更多