Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Can i make arraylist array?

Can i make arraylist array?

Scheduled Pinned Locked Moved C#
questioncsharpdebuggingdata-structureshelp
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    knodark
    wrote on last edited by
    #1

    before my environment vs2005 C#.net and make web project now. while i was mad my code, i need to take some arraylist array. for example... defind arraylist array under the partial class ------------------------------------------------ public ArrayList[,] arFood = new ArrayList[4, 2]; and i use my button click event ------------------------------------------------ arFood[iMeal, 0].Add(CommonLib.IsNullString(myListItem.Value)); but while i was compiled source printed out error message. "System.NullReferenceException" .. so i was debug trace but myListItem.Value was not empty .. so my opinion, that's not initialize arraylist array. how can i initalize my arraylist array? or it's wrong code ? thanks for read my question...

    .. knodark

    C 1 Reply Last reply
    0
    • K knodark

      before my environment vs2005 C#.net and make web project now. while i was mad my code, i need to take some arraylist array. for example... defind arraylist array under the partial class ------------------------------------------------ public ArrayList[,] arFood = new ArrayList[4, 2]; and i use my button click event ------------------------------------------------ arFood[iMeal, 0].Add(CommonLib.IsNullString(myListItem.Value)); but while i was compiled source printed out error message. "System.NullReferenceException" .. so i was debug trace but myListItem.Value was not empty .. so my opinion, that's not initialize arraylist array. how can i initalize my arraylist array? or it's wrong code ? thanks for read my question...

      .. knodark

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      if (arFood[iMeal,0] == null) arFood[iMeal, 0] = new ArrayList() Why would you use an array list and not a generic list ?

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      K M 2 Replies Last reply
      0
      • C Christian Graus

        if (arFood[iMeal,0] == null) arFood[iMeal, 0] = new ArrayList() Why would you use an array list and not a generic list ?

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        K Offline
        K Offline
        knodark
        wrote on last edited by
        #3

        thaks for your reply. i was forgot it. :) it just use temporary memorize during finish user job. well... generic list is light more than arraylist array? .............. append... wow.. that's more short code... :) i was change generic list array :) tanks for your reply... -- modified at 3:27 Tuesday 13th November, 2007

        .. knodark

        1 Reply Last reply
        0
        • C Christian Graus

          if (arFood[iMeal,0] == null) arFood[iMeal, 0] = new ArrayList() Why would you use an array list and not a generic list ?

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          Maybe because he is using .Net < 2.0! Ahh, sorry I forgot I'm the only one who is doing that! :-D

          All the best, Martin

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups