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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Discussing coding style of non-fixed length Multi-dimension Array

Discussing coding style of non-fixed length Multi-dimension Array

Scheduled Pinned Locked Moved Visual Basic
csharpdata-structuresregexhelp
3 Posts 3 Posters 1 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.
  • C Offline
    C Offline
    cylix2000
    wrote on last edited by
    #1

    I have a number of experience on using 2 dimension array in VB.NET, I would like to know some better, and standard pattern to write it. for an example, We need to pass a set of patient record from a modules to a form, this record include all the current male patients(no fixed length). the record includes (name, sex, age) Please give me advise and write down your coding style in this issue. Thanks!!

    G Q 2 Replies Last reply
    0
    • C cylix2000

      I have a number of experience on using 2 dimension array in VB.NET, I would like to know some better, and standard pattern to write it. for an example, We need to pass a set of patient record from a modules to a form, this record include all the current male patients(no fixed length). the record includes (name, sex, age) Please give me advise and write down your coding style in this issue. Thanks!!

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      I wouldn't use arrays at all. Make a class with the properties for a patient. Create objects from the class and put the objects in a list, for an example an ArrayList. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • C cylix2000

        I have a number of experience on using 2 dimension array in VB.NET, I would like to know some better, and standard pattern to write it. for an example, We need to pass a set of patient record from a modules to a form, this record include all the current male patients(no fixed length). the record includes (name, sex, age) Please give me advise and write down your coding style in this issue. Thanks!!

        Q Offline
        Q Offline
        Qhalis
        wrote on last edited by
        #3

        I'll second the other reply and extend it a bit. 1) Create a Patient Class including all the attributes for the patient (name, gender, age, et al.) 2) Create a PatientCollection class, inheriting from CollectionBase (see Walkthroughs in help for details on how to do this) The Patient class is a gimme. It is pretty much a canonical example of a class/object to be used in a program. The PatientCollection is a bit more work than the ArrayList but is safer and since you have Option Strict turned on (hint, hint) it will save some casting in your code. hth Alan.

        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