Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to Store -ve Value in a Byte in Visual Basic

Posted on 2004-09-13
3
Medium Priority
?
239 Views
Last Modified: 2013-11-13
Hey Friends
  I have created an application which accepts some -ve bytes using WinSock control in Visual Basic.
Now the problem is that one byte is having a -ve value and i need to send a -ve value in a byte.
Is it possible by some means to acheive the same.
ie get and send -ve byte using WinSock control ?
0
Comment
Question by:vikrant_kpr
3 Comments
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 500 total points
ID: 12044688
There is no such thing called as a -ve byte.

Probably you mean to say you want to send a byte which represents a negative number. This isn't any different from sending a "normal" byte. If you remember, presentation of negative numbers can be done in two ways, 1's compliment and 2's compliment. Anyway, in order to send a byte representing a negative number you don't need to know all that. Just send it like a number. Dont send it like a string, send it like a number. Let the minus sign (-) preceed the number, VB will automatically send an appropriate byte to the socket.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Introduction to Processes
Loops Section Overview
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question