Not clearing Array....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gobblegob
    New Member
    • Dec 2007
    • 133

    Not clearing Array....

    I am trying to clear the array STR but it does not clear it.
    This sub is in a module.

    Code:
            Dim STR As Array
            'Dim str(6) As String
    
            STR = File.ReadAllLines(Application.StartupPath & "\login\details\" & Login.CboServicePerson.Text & ".pas") ' & (STR(1) & CboText & ".pas"))
            Form1.txtUser.Text = STR(1) 'textline
            Form1.txtPosition.Text = STR(2)
            Form1.txtDepartment.Text = STR(3)
            Form1.txtLicence.Text = STR(4)
            Form1.txtCompany.Text = STR(5)
            Form1.pbUser.Image = Image.FromFile(Application.StartupPath & "\login\image\" & STR(6))
            Form1.pbUser.SizeMode = PictureBoxSizeMode.StretchImage
            Form1.pbUser.BorderStyle = BorderStyle.FixedSingle
            Login.CboServicePerson.DropDownStyle = ComboBoxStyle.DropDownList
    
            Array.Clear(STR, 0, STR.Length)

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

    Gobble.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    What do you mean by not clearing? It should just set all the values to an empty string?

    Comment

    • gobblegob
      New Member
      • Dec 2007
      • 133

      #3
      yeah i mean cannot set to nothing, any idea's ?

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        Why you want them set to nothing, instead of empty strings?
        You are creating an array of strings after all

        Comment

        • gobblegob
          New Member
          • Dec 2007
          • 133

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

          Comment

          Working...