Given an roArray:
found = CreateObject("roArray", 0, true)
found.push("a")
found.push("b")
found.push("c")
What is the best way to check if value s = "s"
?
Given an roArray:
found = CreateObject("roArray", 0, true)
found.push("a")
found.push("b")
found.push("c")
What is the best way to check if value s = "s"
?
If you are looking for something like this:
someArr.contains("s")
There is no such thing, you have to implement it yourself:
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
Currently there are no more efficient ways of doing this.
Don't use roArray - use roAssociativeArray instead:
found = {a: 1, b: 1}
found["c"] = true
if found.doesExist("s") then ...