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. How can we delegate an array

How can we delegate an array

Scheduled Pinned Locked Moved C#
data-structuresquestion
4 Posts 2 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.
  • F Offline
    F Offline
    Fred 34
    wrote on last edited by
    #1

    Assume an array in form1 like this public class ARR1 { public Int64 code; public string name; public bool sup; public bool[] chb = new bool[100]; public string[] param = new string[100]; public void reset() { int i; code = 0; name = ""; sup = false; for (i = 0; i < 100; i++) chb[i] = false; for (i = 0; i < 100; i++) param[i] = ""; } } public ARR1 MainArr = new ARR1(); and ofcourse we have done something with this aaray and it is full of data, in form2 its new data is not accessible. how can we delegate this array in form2 to use its data. this format ( form1 frm1=new form1(); ) doesn't work. thus how can we delegate an array in deferent forms?

    V 1 Reply Last reply
    0
    • F Fred 34

      Assume an array in form1 like this public class ARR1 { public Int64 code; public string name; public bool sup; public bool[] chb = new bool[100]; public string[] param = new string[100]; public void reset() { int i; code = 0; name = ""; sup = false; for (i = 0; i < 100; i++) chb[i] = false; for (i = 0; i < 100; i++) param[i] = ""; } } public ARR1 MainArr = new ARR1(); and ofcourse we have done something with this aaray and it is full of data, in form2 its new data is not accessible. how can we delegate this array in form2 to use its data. this format ( form1 frm1=new form1(); ) doesn't work. thus how can we delegate an array in deferent forms?

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      1. Please use the pre tags to post code (the code button on top of the edit field) 2. Your question does not make sense at all, what are you trying to achieve? 3. What do you mean with: "this format ( form1 frm1=new form1(); ) doesn't work" 4. What do you mean with delegate, because a delegate is a more complex term to explain and I doubt you need that here. I assume you mean something else. 5. You're code looks terrible, if you're a beginner, I suggest you buy a book and follow it from start to end.

      V.

      F 1 Reply Last reply
      0
      • V V 0

        1. Please use the pre tags to post code (the code button on top of the edit field) 2. Your question does not make sense at all, what are you trying to achieve? 3. What do you mean with: "this format ( form1 frm1=new form1(); ) doesn't work" 4. What do you mean with delegate, because a delegate is a more complex term to explain and I doubt you need that here. I assume you mean something else. 5. You're code looks terrible, if you're a beginner, I suggest you buy a book and follow it from start to end.

        V.

        F Offline
        F Offline
        Fred 34
        wrote on last edited by
        #3

        Ill do all your advices and forget my question. as we can delegate for example a textBoxes between forms, I want to know how can we delegate arrays between forms.

        V 1 Reply Last reply
        0
        • F Fred 34

          Ill do all your advices and forget my question. as we can delegate for example a textBoxes between forms, I want to know how can we delegate arrays between forms.

          V Offline
          V Offline
          V 0
          wrote on last edited by
          #4

          You mean you want to pass the information from one form to the next? You can do so by passing it through the constructor or via using a property.

          V.

          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