Connecting Tech Pros Worldwide Help | Site Map

Not clearing Array....

Member
 
Join Date: Dec 2007
Posts: 121
#1: Jul 6 '09
I am trying to clear the array STR but it does not clear it.
This sub is in a module.

Expand|Select|Wrap|Line Numbers
  1.         Dim STR As Array
  2.         'Dim str(6) As String
  3.  
  4.         STR = File.ReadAllLines(Application.StartupPath & "\login\details\" & Login.CboServicePerson.Text & ".pas") ' & (STR(1) & CboText & ".pas"))
  5.         Form1.txtUser.Text = STR(1) 'textline
  6.         Form1.txtPosition.Text = STR(2)
  7.         Form1.txtDepartment.Text = STR(3)
  8.         Form1.txtLicence.Text = STR(4)
  9.         Form1.txtCompany.Text = STR(5)
  10.         Form1.pbUser.Image = Image.FromFile(Application.StartupPath & "\login\image\" & STR(6))
  11.         Form1.pbUser.SizeMode = PictureBoxSizeMode.StretchImage
  12.         Form1.pbUser.BorderStyle = BorderStyle.FixedSingle
  13.         Login.CboServicePerson.DropDownStyle = ComboBoxStyle.DropDownList
  14.  
  15.         Array.Clear(STR, 0, STR.Length)

Also im getting no errors its just not clearing STR.
Thanks in Advanced.

Gobble.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#2: Jul 9 '09

re: Not clearing Array....


What do you mean by not clearing? It should just set all the values to an empty string?
Member
 
Join Date: Dec 2007
Posts: 121
#3: Jul 10 '09

re: Not clearing Array....


yeah i mean cannot set to nothing, any idea's ?
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#4: Jul 10 '09

re: Not clearing Array....


Why you want them set to nothing, instead of empty strings?
You are creating an array of strings after all
Member
 
Join Date: Dec 2007
Posts: 121
#5: Jul 10 '09

re: Not clearing Array....


thanks for the reply mate, but thats what i mean.
Reply