Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The expression being assigned to 'baMsg' must be constant
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
The expression being assigned to 'baMsg' must be constant
Divers
Thread ID:
00970723
Message ID:
00970723
Vues:
107
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.
Répondre
Fil
Voir

Click here to load this message in the networking platform