<html><DIV>
<P>Hi Paul,</P>
<P>I'll have a look at the code you attached when I can.&nbsp; In the meantime, 
though, it looks as though you potentially have 36 on/off flags (A-Z,,0-9) 
defined.&nbsp; This could all be handled as in Hal's tutorial, except that you would 
need 3 16-bit numbers.</P>
<P>Using the bit operations has several advantages over maintaining an options list, 
and undoubtedly some disadvantages as well.&nbsp; I guess the main disadvantage is in 
comprehensibility/clarity.&nbsp; But with bitwise operations, you can 
toggle/turn-on/turn-off/read individual flags VERY efficiently.&nbsp; It also makes 
the options easy to store and pass.&nbsp; You just need some way of knowing that flag 
X is, for example, the 3rd least significant bit (ie the 4s bit) of variable Option2, 
etc.</P>
<P>I imagine that the efficiencies involved in using bitwise operations become even 
greater as the number of flags increases.&nbsp; Really, in one way of looking at 
things, a 16-bit number is just a hyper-efficient array of flags.&nbsp; It's very 
enticing, if you fancy that kind of thing.</P>
<P>See ya,</P>
<P>Lee.</P>
<P>&nbsp;</P></DIV>&gt;From: Paul Smith <[EMAIL PROTECTED]>
<DIV></DIV>&gt;&gt;Or is it that your options are not simple on/off flags, but require 
<DIV></DIV>&gt;&gt;3 or 
<DIV></DIV>&gt;&gt;more states instead of just binary? 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;They're basically on/off. I had been using bit variables for them, 
<DIV></DIV>&gt;but 
<DIV></DIV>&gt;managing bits was getting out of hand. In addition, multiple bits 
<DIV></DIV>&gt;were 
<DIV></DIV>&gt;forcing me to put more data in a query, and pass it to a page, than 
<DIV></DIV>&gt;I thot 
<DIV></DIV>&gt;I needed (8 bits inside SQL Server is one byte, but not when CF gets 
<DIV></DIV>&gt;a hold 
<DIV></DIV>&gt;of 8 0's or 1's outside SQL Server) 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;I went with a list: 1,2,...,9,A,B,...,Z, etc, and I've revised my 
<DIV></DIV>&gt;code 
<DIV></DIV>&gt;today. It's MUCH cleaner and probably faster. 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Some of the list data looks like this: 
<DIV></DIV>&gt; 
<DIV></DIV>&gt;Record FAlist 
<DIV></DIV>&gt;120045 S 
<DIV></DIV>&gt;1235 S,A,1 
<DIV></DIV>&gt;45210 V,5 
<DIV></DIV>&gt;96734 V,1,S 
<DIV></DIV>&gt; 
<DIV>...</DIV><br clear=all><hr>Get Your Private, Free E-mail from MSN Hotmail at <a 
href="http://www.hotmail.com">http://www.hotmail.com</a>.<br></p></html>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to