![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Large Bitmask operation I use bitmasks in tandem with MS SQL Server, used for access permissions but also option lists. I have used this for many years happily. I now have the situation were an option list which was supposed to contain a few items (easily enumerated) will potentially have to hold 100s of items. My issue is that VBScript will not be able to operate on these large numbers as they will be beyond any numeric type inherent in VBScript. I could use a binary varchar in SQL to store values but have the problem of using bitwise comparision in VBScript. I'm sure there must be a way of checking sizes and cutting up the binary into manageable chunks but I have no idea even how to attempt this. I've read some stuff on SQL managing this type of thing but I need a VBS solution. All help is appreciated. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Large Bitmask operation Remy wrote: Quote: >I use bitmasks in tandem with MS SQL Server, used for access permissions >but > also option lists. > > I have used this for many years happily. I now have the situation were an > option list which was supposed to contain a few items (easily enumerated) > will potentially have to hold 100s of items. > > My issue is that VBScript will not be able to operate on these large > numbers > as they will be beyond any numeric type inherent in VBScript. I could use > a > binary varchar in SQL to store values but have the problem of using > bitwise > comparision in VBScript. > > I'm sure there must be a way of checking sizes and cutting up the binary > into manageable chunks but I have no idea even how to attempt this. > > I've read some stuff on SQL managing this type of thing but I need a VBS > solution. > VBScript can represent integers up to 2^53 exactly, but the AND, OR, and XOR functions overflow at 2^31. If I understand correctly, this allows for maybe 30 values (different bit masks). If you coded your own bitwise functions in VBScript you might be able to handle 50 values. I thought SQL Server could handle integers up to 2^64, which doesn't appear to be large enough to handle 100 values. The only method I know of to break up large numbers is the IADsLargeInteger interface provided by ADSI. This interface has a HighPart and LowPart method that breaks up 64-bit integers into two 32-bit values. However, this is only available for Active Directory Integer8 attributes. And even if you could use it, I don't see where this would accomodate 100's of values. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| This operation has been cancelled | Vista General | |||
| The Operation Failed | Microsoft Office | |||
| Moving a large .avi file - "file too large" message | General Discussion | |||
| this operation has ........................:| | General Discussion | |||
| Mouse operation | Vista installation & setup | |||