Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The expression being assigned to 'baMsg' must be constant
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
The expression being assigned to 'baMsg' must be constant
Miscellaneous
Thread ID:
00970723
Message ID:
00970723
Views:
108
I received the following compile error:
The expression being assigned to 'baMsg' must be constant
I imediately knew what was wrong but I don't understand why it is wrong. Here is the code:
const System.Byte[] baMsg = {0x00, 0x00, 0x00, 0xF6};
If I remove the const keyword the class compiles just fine but as far as I can see the expression assigned to baMsg is a constant and I can assure you that I have no intent of changing the contents of my byte array (unless ofcourse the vendor for the device decides to change the command for querying the firmware version)

Can a variable of type System.Byte[] not be a constant?

Any thoughts appreciated.

Sincerely,
Einar
Semper ubi sub ubi.
Reply
Map
View

Click here to load this message in the networking platform