Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

920 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

14 Experts available now in Live!

Get 1:1 Help Now