0
SQL1.ExecNonQuery2("INSERT INTO table1 VALUES(?,?,?)",Array As Object("def",3,4))

I don't seem to understand why the argument list in the above statement is declared in the form of Array as Object('xx','xx''xx').How is it exactly being converted into a list parameter ?

SacGax
  • 157
  • 4
  • 10

1 Answers1

2

Array As xxx is a shorthand syntax for declaring a new array and assigning the values.

Array As Object("def", 3, 4)

Is equivalent to:

Dim arr As Object(3)
arr(0) = "def" : arr(1) = 3 : arr(1) = 4

Basic4android automatically wraps arrays as lists when needed. The items are not copied, it is the whole array that is wrapped in a list. Therefore the above code is valid as it creates an array which is then wrapped as a List.

Erel
  • 1,802
  • 2
  • 15
  • 58