[futurebasic] Re: fun for thought

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1998 : Group Archive : Group : All Groups

From: Lucy24@...
Date: Tue, 29 Sep 1998 12:34:56 EDT
Jonathan said:

>>A bit-twiddler however will see them as 16 continous bit spaces in memory
that can contain 16 different boolean states, but they can be even more than
that!<<

OK, how 'bout this: Suppose I have a whole bunch of variables that are just
one-bit toggles: on/off, true/false, yes/no. If I wanted to pare unused memory
to an absolute minimum, could I pack them 16 at a time into a single integer
variable and pick out the bit I want? For example:

  IF monsterVar% AND 2^n THEN FN doMyStuff(n)