Private fields(3) As String
fields(0) = "Name"
fields(1) = "Age"
fields(2) = "Score"
TestExecNonQuery2("CREATE TABLE persons(? text, ? integer, ? integer)", fields)
Sub TestExecNonQuery2(CmdTemplate As String, CmdParams() As String)
TestExecNonQuery( ReplaceMany(CmdTemplate, "?", CmdParams) )
End Sub
Sub TestExecNonQuery(Cmd As String)
Log("TestExecNonQuery(""" & Cmd & """")
End Sub
Sub ReplaceMany(Template As String, ChangeFrom As String, ChangeTo() As String) As String
Dim Temp As String = Template
For I = 0 To ChangeTo.Length - 1
Dim P As Int = Temp.IndexOf(ChangeFrom)
If P < 0 then
Exit 'no more to find, may as well finish now
End If
Temp = Temp.SubString2(0, P) & ChangeTo(I) & Temp.SubString(P + ChangeFrom.Length)
Next
Return Temp
End Sub