Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
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 
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 
Aha, so the word "public" can precede the word "static" on the same line. My education continues. Obfuscation rules the world.

I just tried your idea.


In my external file which holds the command bytes (Protocol_Stuff.cs) I have these two groups...
C#
static class Class1
{
    static Class1();

    public static byte[] BARN_Command_Hello = new byte[] {
                                            0xFF, 0x00, 0x0B, 0x00,
                                            0x11, 0x22, 0x33, 0x44,
                                            0x55, 0x66, 0x77
                                            }
                                            ;


    public static byte[] BARN_Test = new byte[] {
                                            0xFF, 0x00, 0x0B, 0x00,
                                            0x11, 0x22, 0x33, 0x44,
                                            0x55, 0x66, 0x77
                                            }
                                            ;
}


In the file "Form1.cs" I have this...

C#
private void button2_Click(object sender, EventArgs e)
{
    MessageBox.Show("Value is: {0}", Class1.BARN_Test[1]);
}

When I choose "Build/Build", C# gives me this response...
Error	1	The name 'Class1' does not exist in the current context	E:\YahYah\SoAndSo\Etc\Form1.cs	277	46	TheProgramName_03


So I say: DUH !

This is the problem that I've been trying to overcome for several days. How do I associate the stuff in one file with the stuff in another file ?

e.g., in old-fashioned low-tech anachronistic assembly language (none dare mention speed or size) I would just put...
C#
Extern: BARN_Test
...in the file that uses it and...
C#
Public BARN_Test
...in the file that actually holds the label. The assembler would make the space for it and the linker would put them together.

How do I do that same sort of procedure in C# with separate files ?
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 
AnswerRe: Active Directory UserPrincipal Extension not working Pin
Eddy Vluggen2-Nov-12 0:50
professionalEddy Vluggen2-Nov-12 0:50 
GeneralRe: Active Directory UserPrincipal Extension not working Pin
rcgneo2-Nov-12 5:48
rcgneo2-Nov-12 5:48 
GeneralRe: Active Directory UserPrincipal Extension not working Pin
Eddy Vluggen2-Nov-12 6:56
professionalEddy Vluggen2-Nov-12 6:56 
GeneralRe: Active Directory UserPrincipal Extension not working Pin
rcgneo2-Nov-12 9:35
rcgneo2-Nov-12 9:35 

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.