Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
Does VBA (Excel 97) have bit manipulation functions - shiftleft/right etc? I couldn't find anything that looked promising. Tony |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nope... nothing direct. You could write a program in C/C++ and call that
program through the shell command. That is probably your best option... HTH "Tony" wrote: Hi all, Does VBA (Excel 97) have bit manipulation functions - shiftleft/right etc? I couldn't find anything that looked promising. Tony |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or create your own
Function BitShiftRight(Val As Long, NumBits As Integer) As Long BitShiftRight = Val * (2 ^ NumBits) End Function Function BitShiftLeft(Val As Long, NumBits As Integer) As Long BitShiftLeft = Val \ (2 ^ NumBits) End Function -- HTH RP (remove nothere from the email address if mailing direct) "Jim Thomlinson" wrote in message ... Nope... nothing direct. You could write a program in C/C++ and call that program through the shell command. That is probably your best option... HTH "Tony" wrote: Hi all, Does VBA (Excel 97) have bit manipulation functions - shiftleft/right etc? I couldn't find anything that looked promising. Tony |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That is good for a shift but any idea how you would get any of the other
bitwise operators? I still say you go with C/C++. As an aside to do a bit shift you should just be able to multiply or divide by 2 which in base 2 will functionally shift the bits? I think... I am sure you will let me know Bob... :) "Bob Phillips" wrote: Or create your own Function BitShiftRight(Val As Long, NumBits As Integer) As Long BitShiftRight = Val * (2 ^ NumBits) End Function Function BitShiftLeft(Val As Long, NumBits As Integer) As Long BitShiftLeft = Val \ (2 ^ NumBits) End Function -- HTH RP (remove nothere from the email address if mailing direct) "Jim Thomlinson" wrote in message ... Nope... nothing direct. You could write a program in C/C++ and call that program through the shell command. That is probably your best option... HTH "Tony" wrote: Hi all, Does VBA (Excel 97) have bit manipulation functions - shiftleft/right etc? I couldn't find anything that looked promising. Tony |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give us a break Jim, he only mentioned shifting :-)
Which others are you thinking of, VBA has AND, OR, XOR, IMP and so on? -- HTH RP (remove nothere from the email address if mailing direct) "Jim Thomlinson" wrote in message ... That is good for a shift but any idea how you would get any of the other bitwise operators? I still say you go with C/C++. As an aside to do a bit shift you should just be able to multiply or divide by 2 which in base 2 will functionally shift the bits? I think... I am sure you will let me know Bob... :) "Bob Phillips" wrote: Or create your own Function BitShiftRight(Val As Long, NumBits As Integer) As Long BitShiftRight = Val * (2 ^ NumBits) End Function Function BitShiftLeft(Val As Long, NumBits As Integer) As Long BitShiftLeft = Val \ (2 ^ NumBits) End Function -- HTH RP (remove nothere from the email address if mailing direct) "Jim Thomlinson" wrote in message ... Nope... nothing direct. You could write a program in C/C++ and call that program through the shell command. That is probably your best option... HTH "Tony" wrote: Hi all, Does VBA (Excel 97) have bit manipulation functions - shiftleft/right etc? I couldn't find anything that looked promising. Tony |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
shiftleft/right etc? How about etc... And those operators you mention are
not bitwise are they. If they can be used bitwise let me know... That would be kinda cool... :) "Bob Phillips" wrote: Give us a break Jim, he only mentioned shifting :-) Which others are you thinking of, VBA has AND, OR, XOR, IMP and so on? -- HTH RP (remove nothere from the email address if mailing direct) "Jim Thomlinson" wrote in message ... That is good for a shift but any idea how you would get any of the other bitwise operators? I still say you go with C/C++. As an aside to do a bit shift you should just be able to multiply or divide by 2 which in base 2 will functionally shift the bits? I think... I am sure you will let me know Bob... :) "Bob Phillips" wrote: Or create your own Function BitShiftRight(Val As Long, NumBits As Integer) As Long BitShiftRight = Val * (2 ^ NumBits) End Function Function BitShiftLeft(Val As Long, NumBits As Integer) As Long BitShiftLeft = Val \ (2 ^ NumBits) End Function -- HTH RP (remove nothere from the email address if mailing direct) "Jim Thomlinson" wrote in message ... Nope... nothing direct. You could write a program in C/C++ and call that program through the shell command. That is probably your best option... HTH "Tony" wrote: Hi all, Does VBA (Excel 97) have bit manipulation functions - shiftleft/right etc? I couldn't find anything that looked promising. Tony |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Value manipulation | Excel Discussion (Misc queries) | |||
Data Manipulation. | Excel Discussion (Misc queries) | |||
Can I do graphic manipulation with VBA? | Excel Programming | |||
string manipulation | Excel Programming | |||
String Manipulation | Excel Programming |