2016-09-15 42 views

回答

0

不要使用roArray - 使用roAssociativeArray代替:

found = {a: 1, b: 1} 
found["c"] = true 
if found.doesExist("s") then ... 
2

如果您正在尋找這樣的事情:

someArr.contains("s") 

有沒有這樣的事情,你必須自己實現它:

function contains(arr as Object, value as String) as Boolean 
    for each entry in arr 
     if entry = value 
      return true 
     end if 
    end for 
    return false 
end function 

目前沒有更有效的方法來做到這一點。

+0

你能加入這個聊天嗎? - http://chat.stackoverflow.com/rooms/info/125578/brightscript?tab=general –

相關問題