|
-
Nov 14th, 2002, 04:24 PM
#1
Thread Starter
New Member
Clearing Arrays
I need some help clearing my arrays. The button I have it coded under is on a main form, seperate of the form with the array.
My array is named sArrTicket.
I have it and all my other main arrays that I have to clear declared in a module.
I'm not the worlds greatest at VB.NET , so please be easy on me.
Thanks guys.
-
Nov 14th, 2002, 04:36 PM
#2
In .NET?
Array.Clear(sArrTicket,0,sArrTicket.Length-1)
I think.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 14th, 2002, 04:40 PM
#3
Thread Starter
New Member
yeah..in NET
that code isn't working on my click event, though.
-
Nov 14th, 2002, 04:41 PM
#4
Well, I'm very well versed in .NET, I just pulled that out of help.
Sorry.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 14th, 2002, 04:45 PM
#5
Thread Starter
New Member
I sure wish it would work, though.
This array business is simply beating me over the back of the head.
I also need to pull my array info onto another label on another form seperate of its original form.
Why oh why can't i get a break
-
Nov 14th, 2002, 04:46 PM
#6
yay gay
-
Nov 14th, 2002, 04:48 PM
#7
Thread Starter
New Member
oh, my teacher mentioned something of putting the counter back to 0 or doing something in the loop....
ok, thas probably way too vague.
setting my array = 0 will empty out the array info?
-
Nov 14th, 2002, 07:08 PM
#8
Hyperactive Member
Try using erase Array name
LIke:
Erase sArrTicket
This will clear all data.
Here is a example:
VB Code:
' Declare array variables.
Dim NumArray(10) As Integer ' Integer array.
Dim StrVarArray(10) As String ' Variable-string array.
Dim StrFixArray(10) As String * 10 ' Fixed-string array.
Dim VarArray(10) As Variant ' Variant array.
Dim DynamicArray() As Integer ' Dynamic array.
ReDim DynamicArray(10) ' Allocate storage space.
Erase NumArray ' Each element set to 0.
Erase StrVarArray ' Each element set to zero-length
' string ("").
Erase StrFixArray ' Each element set to 0.
Erase VarArray ' Each element set to Empty.
Erase DynamicArray ' Free memory used by array.
Last edited by Dbee; Nov 14th, 2002 at 07:11 PM.
Don
(OLD DOS Programmer)
-
Nov 14th, 2002, 07:15 PM
#9
Thread Starter
New Member
Originally posted by Dbee
Try using erase Array name
LIke:
Erase sArrTicket
This will clear all data.
Here is a example:
VB Code:
' Declare array variables.
Dim NumArray(10) As Integer ' Integer array.
Dim StrVarArray(10) As String ' Variable-string array.
Dim StrFixArray(10) As String * 10 ' Fixed-string array.
Dim VarArray(10) As Variant ' Variant array.
Dim DynamicArray() As Integer ' Dynamic array.
ReDim DynamicArray(10) ' Allocate storage space.
Erase NumArray ' Each element set to 0.
Erase StrVarArray ' Each element set to zero-length
' string ("").
Erase StrFixArray ' Each element set to 0.
Erase VarArray ' Each element set to Empty.
Erase DynamicArray ' Free memory used by array.
i have my array publicly declared and have tried the Erase arrayname on my click event on another form. This hasn't worked, though?
-
Nov 14th, 2002, 08:34 PM
#10
Thread Starter
New Member
got some help from someone in my class...thought i'd share when erase and other methods just weren't working.
aArrticket(20) = 0
then i just have to clear out the display labels. man..stare at this stuff long enough and you can't even figure out the easy stuff. i'm a dork.
thank you so much for your help, guys..its very clear ya'll are quite well versed.
-
Nov 15th, 2002, 02:12 AM
#11
Frenzied Member
VB Code:
Redim MyArrayHere(0)
MyArrayHere = vbNull
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|