Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
AnswerRe: Spell checker in code Pin
Eddy Vluggen2-Nov-12 9:38
professionalEddy Vluggen2-Nov-12 9:38 
GeneralRe: Spell checker in code Pin
PozzaVecia2-Nov-12 9:44
PozzaVecia2-Nov-12 9:44 
GeneralRe: Spell checker in code Pin
Eddy Vluggen2-Nov-12 10:11
professionalEddy Vluggen2-Nov-12 10:11 
GeneralRe: Spell checker in code Pin
PozzaVecia2-Nov-12 11:22
PozzaVecia2-Nov-12 11:22 
AnswerRe: Spell checker in code Pin
Eddy Vluggen2-Nov-12 11:31
professionalEddy Vluggen2-Nov-12 11:31 
AnswerRe: Spell checker in code Pin
Clifford Nelson2-Nov-12 10:26
Clifford Nelson2-Nov-12 10:26 
GeneralRe: Spell checker in code Pin
PozzaVecia2-Nov-12 11:22
PozzaVecia2-Nov-12 11:22 
QuestionSource file with repetitive data Pin
C-P-User-32-Nov-12 6:02
C-P-User-32-Nov-12 6:02 
I want to have a bunch of byte arrays.

They are commands which will be sent to the external device; generally across some sort of serial port (for now, at least).

I want to put them in their own file.

This is to keep the source files manageable from a human point of view.

Pretty much, 300 lines has shown itself to be a very useful generally defining limit as one of the things that helps source code make sense.

How do I put them in a file of their own which still allows them to be seen and used by the methods in the other files ?

I'm getting errors like, "The name Such_And_So does not exist in the current context".

My search for the answer lead me to a page on MSDN about "Scopes" (Found ^Here^ )

That page has what appears to be 15 rules on the scope of anything.

I tried reading a couple of those rules. In order to understand the first thing about any one of those rules, you have to already be an expert in C# to begin with (in which case, you wouldn't need the rules in front of you in the first place).

I just want to keep my source files orderly.

How do I let the methods in one file see the data packets in another file ?

The arrays will look something like this...

C#
byte[] Command_Number___1 = new byte[] {
                                        0xFF, 0x01, 0x01, 0x01, 
                                        0x01, 0x01, 0x01, 0x01, 
                                        0x01, 0x01, 0x01 
                                        }
                                        ;

byte[] Command_Number___2 = new byte[]  {
                                        0x0E, 0x02, 0x02, 0x02, 
                                        0x02, 0x02, 0x02, 0x02, 
                                        0x02, 0x02, 0x02, 0x02
                                        }
                                        ;

byte[] Command_Number___3 = new byte[]  {
                                        0xFD, 0x03, 0x03, 0x03, 
                                        0x03, 0x03, 0x03, 0x03, 
                                        0x03, 0x03, 0x03, 0x03
                                        0x03
                                        }
                                        ;

byte[] Command_Number___4 = new byte[]  {
                                        0xFC, 0x04, 0x04, 0x04, 
                                        0x04, 0x04, 0x04, 0x04, 
                                        0x04, 0x04, 0x04, 0x04 
                                        0x04, 0x04
                                        }
                                        ;

byte[] Command_Number___5 = new byte[]  {
                                        0xFB, 0x05, 0x05, 0x05, 
                                        0x05, 0x05, 0x05, 0x05, 
                                        0x05, 0x05, 0x05, 0x05,
                                        0x05, 0x05, 0x05
                                        }
                                        ;

byte[] Command_Number_etc = new byte[]  {
                                        0xFA, 0x0E, 0x0E, 0x0E, 
                                        0x0E, 0x0E, 0x0E, 0x0E, 
                                        0x0E, 0x0E, 0x0E, 0x0E,
                                        0x0E, 0x0E, 0x0E, 0x0E
                                        }
                                        ;


When I put them in a separate file, how do I make them visible to other methods which are in other files ?

It's quite conceivable (indeed normal everyday practice) that this concept will be extended to multiple functions, methods, classes, [whatever you want to call them] and variable names, constants, and who knows what else.

Perhaps the question is: How do I get the compiler and the Linker to cooperate between files ?

Whatever, whatever, thanks for the help.
AnswerRe: Source file with repetitive data Pin
Richard MacCutchan2-Nov-12 6:29
mveRichard MacCutchan2-Nov-12 6:29 
GeneralRe: Source file with repetitive data Pin
C-P-User-35-Nov-12 8:00
C-P-User-35-Nov-12 8:00 
GeneralRe: Source file with repetitive data Pin
Richard MacCutchan5-Nov-12 22:02
mveRichard MacCutchan5-Nov-12 22:02 
GeneralRe: Source file with repetitive data Pin
C-P-User-36-Nov-12 6:02
C-P-User-36-Nov-12 6:02 
GeneralRe: Source file with repetitive data Pin
Richard MacCutchan6-Nov-12 6:32
mveRichard MacCutchan6-Nov-12 6:32 
GeneralRe: Source file with repetitive data Pin
C-P-User-36-Nov-12 10:00
C-P-User-36-Nov-12 10:00 
SuggestionRe: Source file with repetitive data Pin
dybs4-Nov-12 17:13
dybs4-Nov-12 17:13 
GeneralRe: Source file with repetitive data Pin
C-P-User-35-Nov-12 4:50
C-P-User-35-Nov-12 4:50 
QuestionHow to get current background color info from a form Pin
MichCl2-Nov-12 5:02
MichCl2-Nov-12 5:02 
AnswerRe: How to get current background color info from a form Pin
Eddy Vluggen2-Nov-12 5:32
professionalEddy Vluggen2-Nov-12 5:32 
GeneralRe: How to get current background color info from a form Pin
MichCl2-Nov-12 7:53
MichCl2-Nov-12 7:53 
GeneralRe: How to get current background color info from a form Pin
Eddy Vluggen2-Nov-12 8:00
professionalEddy Vluggen2-Nov-12 8:00 
GeneralRe: How to get current background color info from a form Pin
MichCl2-Nov-12 8:06
MichCl2-Nov-12 8:06 
QuestionRe: How to get current background color info from a form Pin
Eddy Vluggen2-Nov-12 9:09
professionalEddy Vluggen2-Nov-12 9:09 
GeneralRe: How to get current background color info from a form Pin
Alan N2-Nov-12 10:00
Alan N2-Nov-12 10:00 
AnswerRe: How to get current background color info from a form Pin
Ravi Bhavnani2-Nov-12 9:34
professionalRavi Bhavnani2-Nov-12 9:34 
QuestionActive Directory UserPrincipal Extension not working Pin
rcgneo1-Nov-12 22:44
rcgneo1-Nov-12 22:44 

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.