Solved

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

Posted on 2004-09-13
3
228 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
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.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now