Edit: This was a reply to mn. I was writing this while Steve was posting. My multiple toggle idea is similar to his, apparently, but I haven't coded a database that way before.
-----------------------
I have a two track mind, but getting a train of thought to run on either is darn near impossible these days...
Yeah one of the things that I haven't explored yet is using _TOGGLEBIT to keep track of multiple toggle conditions.
Terrible example, but I really can't wrap my 'train' around anything more practical I'd use this with at the moment. (Edit: And then Steve posted his database management example.)
Pete
-----------------------
I have a two track mind, but getting a train of thought to run on either is darn near impossible these days...
Yeah one of the things that I haven't explored yet is using _TOGGLEBIT to keep track of multiple toggle conditions.
Code: (Select All)
DIM AS INTEGER a, b, c
DO
INPUT "Press 1 for cat 2 for dog: "; a: a = a - 1: a = _TOGGLEBIT(a, 0)
INPUT "Press 1 for happy 2 for sad: "; b: b = b - 1: b = _TOGGLEBIT(b, 1)
INPUT "Press 1 for black 2 for white: "; c: c = c - 1: c = _TOGGLEBIT(c, 2)
IF _TOGGLEBIT(b, 1) THEN PRINT "happy" ELSE PRINT "sad"
IF _TOGGLEBIT(c, 2) THEN PRINT "black" ELSE PRINT "white"
IF _TOGGLEBIT(a, 0) THEN PRINT "cat" ELSE PRINT "dog"
PRINT
LOOP
Terrible example, but I really can't wrap my 'train' around anything more practical I'd use this with at the moment. (Edit: And then Steve posted his database management example.)
Pete