gmulhall
06-13-2007, 04:40 AM
Hi,
 
I have a need to set one or more bits in a long integer.
 
Each bit in the long represents assignment to one or more lists.
 
I'm actually updating a database in the Stock Trading Charting package Amibroker.
 
An example is provided in JScript - but I'd like to code in Excel VBA (my language of choice).
 
The example is below.
 
Stock.WatchListBits (long) - each bit 0..31 represents assignment to one of 32 watch lists to add a stock to nth watch list write (JScript example):
Stock.WatchListBits |= 1 << nth;
From Bullen/Bovey/Green I understand I need to use a Bitmask but I have no example. Did not find anything in Excel help either.
 
Is this do-able in Excel ? Does anyone have an example pls ?
 
Thanks as always,
 
Geoff
I have a need to set one or more bits in a long integer.
Each bit in the long represents assignment to one or more lists.
I'm actually updating a database in the Stock Trading Charting package Amibroker.
An example is provided in JScript - but I'd like to code in Excel VBA (my language of choice).
The example is below.
Stock.WatchListBits (long) - each bit 0..31 represents assignment to one of 32 watch lists to add a stock to nth watch list write (JScript example):
Stock.WatchListBits |= 1 << nth;
From Bullen/Bovey/Green I understand I need to use a Bitmask but I have no example. Did not find anything in Excel help either.
Is this do-able in Excel ? Does anyone have an example pls ?
Thanks as always,
Geoff