PC Review


Reply
Thread Tools Rate Thread

how can I clear the content of an public Array?

 
 
Jan
Guest
Posts: n/a
 
      13th Oct 2003
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)
 
Reply With Quote
 
 
 
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      13th Oct 2003
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" <(E-Mail Removed)> wrote in message
news:15gd6iawzroxs.t5rp2wq5c30k$.(E-Mail Removed)...
> 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)



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      13th Oct 2003
* Jan <(E-Mail Removed)> 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>
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array.Clear vs List<>.Clear Lee Crabtree Microsoft C# .NET 43 8th Oct 2007 08:11 PM
Clear an XML Map of all content DangerMouse Microsoft Excel Programming 1 23rd Jun 2006 02:43 PM
Clear Columns Content Lizz45ie Microsoft Excel Programming 1 3rd Nov 2005 04:53 PM
how can I get the content of a textbox into a public array Jan Microsoft VB .NET 4 20th Oct 2003 02:13 PM
how do I clear the content of an Array Jan Microsoft VB .NET 3 13th Oct 2003 02:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:21 PM.