How can one make an array empty? Once I am finsished with a rather large array I would like to complete wipe all values (I think, but don't know, that this would provide more free memory for the system).
Can someone help?
Printable View
How can one make an array empty? Once I am finsished with a rather large array I would like to complete wipe all values (I think, but don't know, that this would provide more free memory for the system).
Can someone help?
erase myarray (or whatever your array is named. It's that easy!
Cheers
If i have a situation like this
Name(1)="Hi"
Name(2)="Hi2"
if i want to print both together , can i have it like this
picture1.print name()?
i know i can use loop like this
for i = 1 to 2
picture1.print name(i)
next i
wonder if the first one is correct
thanks
Nope!!! The first instance will not work. If you want them both to print on the same line separated by commas do something like this:
Name(1)="Hi"
Name(2)="Hi2"
for i = 1 to 2
allnames = allnames & ", " & name(i)
next i
printer.print allnames
allnames should look like this Hi, Hi2
(I notice you have picture1.print in your code. Do you know that you cannot print to a picture?)
Assumin Picture1 is a picture box and you are just printing
to a picture box.
Name is a reserved word so use sName
Dim sName(1 To 2) As String
sName(1) = "Hi"
sName(2) = "Hi2"
Picture1.Print sName(1) & "," & sName(2)
If you have information stored in an array you don't need to loop through the array to read the elements. You merely call them by index.