Click here to Skip to main content
15,915,336 members
Home / Discussions / C#
   

C#

 
AnswerRe: A good way to store this information? PinPopular
Luc Pattyn16-Oct-10 13:24
sitebuilderLuc Pattyn16-Oct-10 13:24 
GeneralRe: A good way to store this information? Pin
Keith Barrow17-Oct-10 4:58
professionalKeith Barrow17-Oct-10 4:58 
GeneralRe: A good way to store this information? Pin
stephen.darling17-Oct-10 10:29
stephen.darling17-Oct-10 10:29 
AnswerRe: A good way to store this information? Pin
PIEBALDconsult17-Oct-10 13:26
mvePIEBALDconsult17-Oct-10 13:26 
GeneralRe: A good way to store this information? Pin
stephen.darling17-Oct-10 15:05
stephen.darling17-Oct-10 15:05 
GeneralRe: A good way to store this information? Pin
PIEBALDconsult17-Oct-10 15:12
mvePIEBALDconsult17-Oct-10 15:12 
GeneralRe: A good way to store this information? Pin
stephen.darling18-Oct-10 5:00
stephen.darling18-Oct-10 5:00 
AnswerRe: A good way to store this information? Pin
W Balboos, GHB20-Oct-10 1:29
W Balboos, GHB20-Oct-10 1:29 
In real life, I was a chemist - and although the several suggestions for an enum are a direct way to create your listing, I would look towards future use (which is likely to come, some day), where you'd maybe want to add the atomic no., valence, atomic wt., phase at STP, full name (viz-a-viz, symbol) and so on.

It's very little additional effort to prepare for these potentialities: create a data class, each element receiving its own instance. Declare a data member for each additional feature as you need them.

As for the container, the Dictionary is a good option for your original task, conversion of formulas into molecular weights. Note that using the data class allows you to store your initialization data for the table in a wide variety of formats: from hard coded to database.

An additional consideration: getting familiar with generalized solutions to a problem (extensible data class) will make good practice for solving general problems in the future. After all, how different is the periodic table data from a music library or phone book?











"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"As far as we know, our computer has never had an undetected error." - Weisert
"If you are searching for perfection in others, then you seek dissappointment. If you are searching for perfection in yourself, then you seek failure." - Balboos HaGadol Mar 2010

GeneralRe: A good way to store this information? Pin
stephen.darling20-Oct-10 7:40
stephen.darling20-Oct-10 7:40 
QuestionDynamic array of PictureBoxes with scroll-bars? Pin
DaveGriffith15-Oct-10 15:59
DaveGriffith15-Oct-10 15:59 
AnswerRe: Dynamic array of PictureBoxes with scroll-bars? Pin
Luc Pattyn15-Oct-10 17:27
sitebuilderLuc Pattyn15-Oct-10 17:27 
AnswerRe: Dynamic array of PictureBoxes with scroll-bars? Pin
DaveGriffith17-Oct-10 10:33
DaveGriffith17-Oct-10 10:33 
GeneralRe: Dynamic array of PictureBoxes with scroll-bars? Pin
Luc Pattyn17-Oct-10 10:41
sitebuilderLuc Pattyn17-Oct-10 10:41 
GeneralRe: Dynamic array of PictureBoxes with scroll-bars? Pin
forkus200024-Oct-10 19:15
forkus200024-Oct-10 19:15 
GeneralRe: Dynamic array of PictureBoxes with scroll-bars? Pin
Luc Pattyn25-Oct-10 2:09
sitebuilderLuc Pattyn25-Oct-10 2:09 
QuestionEllipse Pin
WebMaster15-Oct-10 15:17
WebMaster15-Oct-10 15:17 
AnswerRe: Ellipse Pin
Richard Andrew x6415-Oct-10 16:16
professionalRichard Andrew x6415-Oct-10 16:16 
GeneralMessage Removed Pin
15-Oct-10 16:30
WebMaster15-Oct-10 16:30 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 16:33
professionalRichard Andrew x6415-Oct-10 16:33 
GeneralRe: Ellipse Pin
WebMaster15-Oct-10 16:47
WebMaster15-Oct-10 16:47 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 16:53
professionalRichard Andrew x6415-Oct-10 16:53 
GeneralRe: Ellipse Pin
WebMaster15-Oct-10 17:01
WebMaster15-Oct-10 17:01 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 17:03
professionalRichard Andrew x6415-Oct-10 17:03 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 17:36
professionalRichard Andrew x6415-Oct-10 17:36 
GeneralRe: Ellipse Pin
WebMaster16-Oct-10 8:24
WebMaster16-Oct-10 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.