Ok, different question. How do I put 2 received bytes back together to make 1 word?
Ok, different question. How do I put 2 received bytes back together to make 1 word?
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Like you did have to be fine.
WordOut=(MSByte*256)+LSByte
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well not saying its is the best way by any means, but this seems to work:
Thanks for the help guys, for now this will cover my needsCode:Dim i AsInteger Dim t AsUShort Dim datain AsByte Dim data(20) AsByte Dim sign AsString t = (data(0) * 256) + data(1) If t > 32767 Then t = (Not t) + 1 sign = "-" Else : sign = " " EndIf gxhb.Text = sign & t.ToString
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Seems like it should be much easier.![]()
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
yeah but where would be the fun![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well I guess it would be a little better if that snippet was a sub routine, or function, or module, or object. See, I don't even know what it should be.
To me a sub-routine. I want to call it with values in data1 and data2. it should return with a string in wordout.
But that is just a little above my pay grade right now.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Once you feel you're ready, have a look at this
http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
Then you could use something like
txtResult.txt = ConvertWordToSignedString (WordVariable)
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks