Quote:
Originally Posted by Katsunami
It comes directly from the manufacturer of the device I'm trying to communicate with. There isn't anything else. I'm trying to lift the protocol from the code, but it's scattered throughout a single, 1079 lines long Windows form. Some of the required settings are actually acquired directly from the controls. Think like so:
buffer[5] = (byte)(button4.Text.Split(" ")[1])
(Split the text on button 4 into two parts, take the second part, and then convert it to a byte. It's not really obvious at first glance what value goes into buffer[5], to say the least, especially because button4.Text can change depending on the state of the program  )
|
Ouch, that is bad programming... Using generic variable names and not giving controls logical names is not good nor smart. It was excusable when I started programming in the 80s, because there was hardly any memory to play with and every byte counted. Not anymore though, not even for a 'fast track'.