473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

vb.net: managing bit and bytes

Hi,
I need to set the value of 8 bit variables separately and then put them into
a byte variable.

Is it possible using VB.NET. How?

Thank you very much.
Jul 21 '05 #1
2 5954
Try "or" :

MsgBox(Hex$(1 Or 2 or 4 Or 8))

--

"Federico Caselli" <Fe*************@discussions.microsoft.com> a écrit dans
le message de news:8D**********************************@microsof t.com...
Hi,
I need to set the value of 8 bit variables separately and then put them into a byte variable.

Is it possible using VB.NET. How?

Thank you very much.

Jul 21 '05 #2
You'll need to "shift" them. AFAIK the fist operator is not currently
available (I believe this will show up in VB 2005).

Meanwhile and unless you need to do that a fair amount of time you could do
:

allBits=bit1+bit2*2+bit3*4+bit4*8 etc...

Another option would be to see if the BitArray class could help :
http://msdn.microsoft.com/library/de...mberstopic.asp
(never usde it but rmember to have seen it)

Patrice
--

"Federico Caselli" <Fe*************@discussions.microsoft.com> a écrit dans
le message de news:4A**********************************@microsof t.com...
Thank you for answering, but I'd need to set boolean values of bits
separately, something like:

bit1 = 1
bit2 = 0
bit3 = 1
...
bit8 = 0

and then put them into a unique byte variabile in the right order.

Thank you

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Georgeo Pulikkathara[MS] | last post by:
ASP.NET Webcast Week - January 19 - 23, 2004 Learn about ASP.NET from the experts! These free webcasts are live and interactive. Live code demos and attendees asking in depth engaging questions are...
4
by: Shawn Brock | last post by:
This is a wildly broad question, so apologies in advance. I developed a very traditional app architecture in Visual Studio 5-6. The basic structure looked like this: GUI >> MTS >> Database The...
10
by: Kleenex | last post by:
Reason: I am working on an embedded project which has very limited memory (under 512 bytes, 60 or so of which is stack space), which translates into limited stack space. In order to save on stack...
0
by: Georgeo Pulikkathara[MS] | last post by:
ASP.NET Webcast Week - January 19 - 23, 2004 Learn about ASP.NET from the experts! These free webcasts are live and interactive. Live code demos and attendees asking in depth engaging questions are...
16
by: Kent | last post by:
We have created several Assemblies that we add to the GAC on our web servers. In an ASP.NET app in VS2003, Adding a reference to strong named GAC'd Assembly meant that the web app would use...
2
by: Federico Caselli | last post by:
Hi, I need to set the value of 8 bit variables separately and then put them into a byte variable. Is it possible using VB.NET. How? Thank you very much.
0
by: GreggTB | last post by:
I have written two custom providers for our Oracle 9i database...a Membershp provider and a Role provider. I've been testing these over the last few days and they seem to be working well. However,...
6
by: Jerry Spence1 | last post by:
My company produces IP Surviellance softwrae (CCTV, Access control etc) and one of the features of our software is the ability to produce a CD with all the images, together with a run time version...
0
by: shamirza | last post by:
· When was .NET announced? Bill Gates delivered a keynote at Forum 2000, held June 22, 2000, outlining the .NET 'vision'. The July 2000 PDC had a number of sessions on .NET technology, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.