Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bitwise shifting

Posted on 1998-10-08
1
Medium Priority
?
229 Views
Last Modified: 2010-04-30
How do I do bitwise shifting in VB
0
Comment
Question by:MikeP090797
1 Comment
 
LVL 2

Accepted Solution

by:
schild earned 40 total points
ID: 1438832
This is simple as you say, you say it by give 15 points :)

to shift to the left just multiple by 2
MyNumner = MyNumner * 2

to shift to the right just divide by 2
MyNumner = MyNumner/2
But this time you need to delete the last bit in case the number was negative so
Do this AND it with the bigest positive number of the variable
In case if byte its 127 so
MyNumner = (MyNumner/2) and 127

Good Luck

Schild
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

971 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