473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how can I clear the content of an public Array?

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
2 5784
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
* 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Davie | last post by:
I'm developing an application on the smartphone. To reduce the size of the application i'm using panels where appropriate instead of forms. As a result of the design, I need to have different...
1
by: feng | last post by:
The Combobox1.item.clear doesn't seem to work for me correctly. I have a Combox with a datasource bind to it. When I try to clear the Combobox with the following code: Combobox1.DataSource =...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
1
by: laurakr | last post by:
I am trying to use a clear to get my bottom nav bar below the quote box on the right, but it isn't working. I would like the bottom edge of the quote box to "stick" to the footer nav bar but copy...
3
by: synergy_711 | last post by:
I feel like this should be fairly easy but I have been struggling with this for sometime. I have not been able to find someone who's had the same problem as mine yet. ...
35
by: Lee Crabtree | last post by:
This seems inconsistent and more than a little bizarre. Array.Clear sets all elements of the array to their default values (0, null, whatever), whereas List<>.Clear removes all items from the...
2
by: Kazzie | last post by:
I have a structure struct Rulestrc { char* rulen; vector<char*>v6; char* resp; }; I then create an array of structures - Rulestrc tp. However the content of tp is constantly changing...
2
Claus Mygind
by: Claus Mygind | last post by:
I have an array of objects (a hash table). My section of code, the "for in" loop (lines 18 to 41) does not execute at full speed. But if I put in an alert box (line 13) to stop program execution...
5
aas4mis
by: aas4mis | last post by:
I haven't had much luck with specific controls, their properties and loops in the past. I thought I would share this tidbit of code, feel free to modify/modularize in any way to suit your needs. This...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.