473,549 Members | 2,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5963
Try "or" :

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

--

"Federico Caselli" <Fe************ *@discussions.m icrosoft.com> a écrit dans
le message de news:8D******** *************** ***********@mic rosoft.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+bi t2*2+bit3*4+bit 4*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.m icrosoft.com> a écrit dans
le message de news:4A******** *************** ***********@mic rosoft.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
1469
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 all part of these live webcasts. This is a great way to get educated, engaged, and enlightened on Microsoft ASP.NET. Register for all 12 webcasts at...
4
1949
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 basic idea here was Users talk to the object, the object logs in to the database as itself and does some work. Perhaps I'm being overly dense, but...
10
2622
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 space, I tried to only use parameters and stack space for things which are truely temporary. Instead of passing a pointer to a data structure which...
0
1437
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 all part of these live webcasts. This is a great way to get educated, engaged, and enlightened on Microsoft ASP.NET. Register for all 12 webcasts at...
16
2069
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 whatever version was in the GAC. Now in an ASP.NET app in VS 2005, adding a reference to a GAC'd assembly actually adds a version specific reference to...
2
353
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
1795
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, when I try to use the ASP.NET 2.0 Web Site Administration Tool in VS 2005, I get an error when I click on the "Create User" link. On the tool's...
6
1078
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 of the viewer. The intention is that anyone (the police) can insert the CD into any PC and see the video sequence. This all worked OK (ish) in...
0
3645
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 delegates were given CDs containing a pre-release version of the .NET framework/SDK and Visual Studio.NET. · When was the first version of .NET released?...
0
7520
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7809
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6043
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
763
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.