how can I clear the content of an public Array?

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

This is de public array I use, intline is a variable integer also declared
as public in a module.
I want to clear the content of the string array strOrderList in Form2, but
i get a error in form1. How can i do this??

strOrderList.Clear(?, 0, intLine)
 
Jan,
Remember: Array.Clear is a shared method, I normally use the class name
itself with shared methods to avoid confusion.

Have you tried something like:

Dim strOrderList() As String
Array.Clear(strOrderList, 0, strOrderList.Length)

I use strOrderList.Length instead of intLine, as I'm not sure if intLine is
"off by one". I don't know if you defined it as the number of elements or
the high index, remember that VB.NET uses high index, where as the Framework
uses number of elements. Arrays start at zero, so there is a "off by one"
potential.

Hope this helps
Jay
 
* Jan said:
This is de public array I use, intline is a variable integer also declared
as public in a module.
I want to clear the content of the string array strOrderList in Form2, but
i get a error in form1. How can i do this??

What error?
 
Back
Top