Click here to Skip to main content
15,896,730 members
Home / Discussions / C#
   

C#

 
GeneralRe: datagrid in Compact Frame work Pin
jashimu18-Jun-10 9:12
jashimu18-Jun-10 9:12 
QuestionFold all code in all of the project with one command Pin
Neo1010114-Jun-10 4:29
Neo1010114-Jun-10 4:29 
AnswerRe: Fold all code in all of the project with one command Pin
R. Giskard Reventlov14-Jun-10 4:58
R. Giskard Reventlov14-Jun-10 4:58 
GeneralRe: Fold all code in all of the project with one command Pin
Neo1010114-Jun-10 8:27
Neo1010114-Jun-10 8:27 
Questionthread and application response Pin
kasraa0009800014-Jun-10 4:29
kasraa0009800014-Jun-10 4:29 
AnswerRe: thread and application response Pin
Luc Pattyn14-Jun-10 4:35
sitebuilderLuc Pattyn14-Jun-10 4:35 
Questiona bad control !!!! Pin
reza assar14-Jun-10 3:52
reza assar14-Jun-10 3:52 
AnswerRe: a bad control !!!! Pin
ostad_mrn14-Jun-10 4:24
ostad_mrn14-Jun-10 4:24 
QuestionUSB Reader Pin
S.Aijaz14-Jun-10 3:44
S.Aijaz14-Jun-10 3:44 
Answercross-post Pin
Luc Pattyn14-Jun-10 3:55
sitebuilderLuc Pattyn14-Jun-10 3:55 
QuestionDemo Deployment Pin
eraser95014-Jun-10 3:17
eraser95014-Jun-10 3:17 
AnswerRe: Demo Deployment Pin
Johnny J.14-Jun-10 3:36
professionalJohnny J.14-Jun-10 3:36 
AnswerRe: Demo Deployment Pin
kasraa0009800014-Jun-10 4:34
kasraa0009800014-Jun-10 4:34 
QuestionClass methods for accessing/modifying multiple array variables Pin
BenBJT14-Jun-10 2:59
BenBJT14-Jun-10 2:59 
AnswerRe: Class methods for accessing/modifying multiple array variables Pin
Łukasz Nowakowski14-Jun-10 3:15
Łukasz Nowakowski14-Jun-10 3:15 
AnswerRe: Class methods for accessing/modifying multiple array variables Pin
Luc Pattyn14-Jun-10 3:26
sitebuilderLuc Pattyn14-Jun-10 3:26 
Rather than having several arrays running in parallel, you could create a single array holding instances of a new class or struct. Example:

public class Channel {
        public Boolean ChLog;
        public String Label;
        public int CallibrationUnit;
}

public class Test {
        private Channel[] channels=new Channel[12];
}


The choice between class and struct is yours; for bigger objects, I would favor class, and also when references come in handy, as in what follows.

Finally, rather than setting an upper limit for the number of channels you can handle, it is often better to use a collection, as in:

public class Test {
        private List<Channel> channels=new List<Channel>();

...
        channels.Add(new Channel(true, "aha", 3)); // needs a constructor!
        Console.WriteLine(channels[3].ToString()); // needs a ToString definition
...
}


One advantage of generic lists is they don't need a dimension, as they can grow dynamically.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

Nil Volentibus Arduum

modified on Monday, June 14, 2010 9:46 AM

Questionhow i know when user created Pin
noamtzu0014-Jun-10 2:47
noamtzu0014-Jun-10 2:47 
AnswerRe: how i know when user created Pin
Pete O'Hanlon14-Jun-10 3:36
mvePete O'Hanlon14-Jun-10 3:36 
GeneralRe: how i know when user created Pin
noamtzu0014-Jun-10 18:33
noamtzu0014-Jun-10 18:33 
QuestionGetting a column or parameter's data type from the database [modified] Pin
JohnLBevan14-Jun-10 1:42
professionalJohnLBevan14-Jun-10 1:42 
AnswerRe: Getting a column or parameter's data type from the database Pin
PIEBALDconsult14-Jun-10 2:44
mvePIEBALDconsult14-Jun-10 2:44 
GeneralRe: Getting a column or parameter's data type from the database Pin
JohnLBevan14-Jun-10 8:40
professionalJohnLBevan14-Jun-10 8:40 
GeneralRe: Getting a column or parameter's data type from the database Pin
PIEBALDconsult14-Jun-10 13:48
mvePIEBALDconsult14-Jun-10 13:48 
QuestionA few questions Pin
SRJ9214-Jun-10 1:12
SRJ9214-Jun-10 1:12 
AnswerRe: A few questions Pin
Eddy Vluggen14-Jun-10 2:08
professionalEddy Vluggen14-Jun-10 2:08 

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.