none
Property 'Chars' is 'ReadOnly', Visual Studio 2010

    Question

  • I get the Error Property 'Chars' is 'ReadOnly'
    I am using VS 2010 
    The Following code outputs the Error, it appears 5 times at the lines with Array_A(x) = "x"
    So what am i doing wrong? i cant figure it out...
    Public Module Data
       
        Public Array_A As String
    
        Public Sub DefineArrayData()
            Array_A(1) = "a"
            Array_A(2) = "b"
            Array_A(3) = "c"
            Array_A(4) = "d"
            Array_A(5) = "e"
        End Sub
    End Module
    

    Edit: I cut down the code, i actually dont assign a,b,c,d,e to them but the error is the same
    • Edited by Blacktronics Saturday, December 17, 2011 6:19 PM
    Saturday, December 17, 2011 6:17 PM

Answers

  • Hi,
    welcome to msdn forums.

    Public Module Data
      
        Public Array_A(6) As String

        Public Sub DefineArrayData()
            Array_A(1) = "a"
            Array_A(2) = "b"
            Array_A(3) = "c"
            Array_A(4) = "d"
            Array_A(5) = "e"
        End Sub
    End Module

     or

     

     

    Public Array_A As String =

    ""

    Array_A =

    "abcd"

    Array_A &=

    "x"

    I hope it will helps you and solve you your problem
    By
    A Pathfinder..
    JoSwa


    If you find an answer helpful, click the helpful button. If you find an answer to your question, mark it as the answer.
    Saturday, December 17, 2011 6:22 PM

All replies

  • Hi,
    welcome to msdn forums.

    Public Module Data
      
        Public Array_A(6) As String

        Public Sub DefineArrayData()
            Array_A(1) = "a"
            Array_A(2) = "b"
            Array_A(3) = "c"
            Array_A(4) = "d"
            Array_A(5) = "e"
        End Sub
    End Module

     or

     

     

    Public Array_A As String =

    ""

    Array_A =

    "abcd"

    Array_A &=

    "x"

    I hope it will helps you and solve you your problem
    By
    A Pathfinder..
    JoSwa


    If you find an answer helpful, click the helpful button. If you find an answer to your question, mark it as the answer.
    Saturday, December 17, 2011 6:22 PM
  • Thanks a lot, it works :)

     

    Saturday, December 17, 2011 6:25 PM
  • Arrays are zero based by the way.

     

     

    Saturday, December 17, 2011 10:50 PM