Solved

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

Posted on 2004-09-13
3
233 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 125 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

685 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