Solved

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

Posted on 2004-09-13
3
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

751 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