In VB.net, is there a way to assign values to an array of structure in a single line? For example if I have an array of structure like this:
Public Structure CommandInfo
Public CommandChar As Char
Public CommandType As String
Public Description As String
End Structure
Public CommandSet(NumCommands - 1) As CommandInfo
Is there a way to assign values to the array like this:
CommandSet(0)={"C", "Initialization", "Initialize pump motor"}
Otherwise, I've been having to do a line of code for each structure element for each array element--it's a little ugly. Thanks!
Addroutine taking three arguments, you can array syntax like{{"C", "Initialization", "..."}, {"D", "Deletion", "..."}}etc. As a small aside, I'd suggest you turnOption Strict On. You should need to specify the character argument as"C"C.