c# - VB.Net Inline comments -
being c#
developer, surprised find couldn't create inline comments
within array
declaration.
in test case want simulate 2 byte array
packets coming through together:
dim buffer byte() = { &hf5, &h5, &h53, ... many more bytes &h1, &h2, &hce, &hf5, 'new packet starts here... doesn't work :( &h5, &h53, ... many more bytes &h1, &h2, &h1a }
surely i'm missing something, possible place inline comments within array declaration?
if not, there decent work around? need split array 2 , join them together?
thanks in advance.
no not possible.
but, found out yourself, in future version - visual basic 14 (visual studio 2015) possible new language features in visual basic 14
for current version can create named variable , use in array declaration
dim newpacketstarts byte = &hf5
if have lot of hardcoded values - create constants describable names
const startofnewpacket byte = &hf5 const anothervalue byte = &h1 const anothernewvalue byte = &hf53 '...
declare array then
dim buffer byte() = { startofnewpacket, anothervalue, anothernewvalue }
Comments
Post a Comment