How can I empty an array?
Code: Select all
global SearchWordsArray := Object()
; fill it with stuff, do stuff with it then... try this but it doesn't appear to work
SearchWordsArray.RemoveAll()
; then refill with other stuff and so on
Code: Select all
global SearchWordsArray := Object()
; fill it with stuff, do stuff with it then... try this but it doesn't appear to work
SearchWordsArray.RemoveAll()
; then refill with other stuff and so on
Code: Select all
Array:=["a","b"]
MsgBox % ">" Array[1] "<"
Array:=[]
MsgBox % ">" Array[1] "<"
Array.Push("a")
MsgBox % ">" Array[1] "<"
Code: Select all
global SearchWordsArray := Object()
; fill it with stuff, do stuff with it then... empty it thus:
SearchWordsArray := Object()
; then refill with other stuff and so on
Code: Select all
SearchWordsArray := ""
Code: Select all
global SearchWordsArray := Object()
; do some stuff
SearchWordsArray := ""
; load array
Code: Select all
global SearchWordsArray := Object()
; do some stuff
SearchWordsArray := Object()
; load array
Code: Select all
SearchWordsArray := Object()
SecondReference := SearchWordsArray
if (SecondReference == SearchWordsArray)
MsgBox Both variables contain the same array.
SearchWordsArray.Push(42)
MsgBox % SecondReference[1] ; 42
SearchWordsArray := ""
MsgBox % SecondReference[1] ; 42 -- Array is not empty!
Code: Select all
if SearchWordsArray.MinIndex() != "" ; Not empty.
SearchWordsArray.Delete(SearchWordsArray.MinIndex(), SearchWordsArray.MaxIndex())
Code: Select all
SearchWordsArray.Delete(1, SearchWordsArray.Length())
Code: Select all
SearchWordsArray.Delete("", last_key)
Users browsing this forum: mstrauss2021, peter_ahk, Spawnova, william_ahk, zephyrus2706 and 359 guests