Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Bitwise operation


Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2004, 02:11 PM
knootz knootz is offline
Freshman
 
Join Date: Mar 2004
Posts: 37
Default Bitwise operation


Hi... i'm just asking some questions which might be very easy ... but i'm still new... pls pardon me.

For Bitwise Operation of e.g. A=&H5 and B = &H1F

Can i do this for AND and OR operation, and it will perform a bitwise so long it is a number rit??

Result = A AND B
Result = A OR B

How do i translate the follow in C++ to Visual Basic..

ts=(Buffer[3] == 0)? 1:2<< Buffer[3];

Thank you
Reply With Quote
  #2  
Old 04-15-2004, 02:40 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,885
Default

It's basically an IF THEN ELSE construction:
Code:
If (Buffer[3]==0)
  ts = 1;
Else
  ts = 2 << Buffer[3];
The only thing VB doesn't support is << which is a shift left bit operation.
You have to search for some vb code to simulate this functionallity.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to cancel copy operation? kalpana_lloyd Database and Reporting 0 09-29-2003 06:00 AM
Constants? (Basic) Ega API 15 06-17-2003 09:56 PM
bitwise AND with checkbox bigfootlabs Database and Reporting 0 02-27-2003 10:48 AM
ADODC says Operation Cancelled. Why? Bunnie Database and Reporting 1 09-11-2002 09:00 AM
Access Illegal Operation Error nickg96 Database and Reporting 6 09-10-2002 12:53 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->