Results 1 to 2 of 2

Thread: [RESOLVED] Question about lists

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2007
    Posts
    44

    Resolved [RESOLVED] Question about lists

    Hello everyone,

    I've run into a problem while working on my simple game mapmaker.
    I'm using a list to store my monsters like this:
    Code:
    Public stMobList As New List(Of static_monster)
       Public Structure static_monster
            Dim name As String
            Dim placement As Coordinate
            Dim kind As Integer
        End Structure
       Public Structure Coordinate
            Dim x As Integer
            Dim y As Integer
        End Structure
    So the problem which I came up with is, that I can't change the stored information within the list like:
    Code:
         stMobList.Item(1).name.ToString = "Hi"
    I've also tried the replace function.
    Code:
    stMobList.Item(1).name.ToString.Replace(stMobList.Item(1).name, "newname")
    Which didn't work either with how I tried to use it.
    So my question is how can I do this and make it work?

    Already thanks,

    Jurre

  2. #2
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Question about lists

    Code:
    Dim s As static_monster = stMobList.Item(1)
    s.Name = "Hi"
    stMobList.Item(1) = s

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width