By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,797 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

how can I clear the content of an public Array?

P: n/a
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)
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <ca*****@planet.nl> wrote in message
news:15*****************************@40tude.net... 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)

Nov 20 '05 #2

P: n/a
* Jan <ca*****@planet.nl> scripsit:
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?

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.