[AccessD] OT: Programming Logic

Joe Rojas JRojas at tnco-inc.com
Sun Feb 16 11:56:01 CST 2003


It is kind of odd but not wholly disconnected. The reason I was asking is
because I am also working on a "scheduling" type of project. One where a
user can create recurring events. I am using the look and feel for my form
that is very similar to Outlook. I didn't want to store every actually
occurrence of an event. I was looking to store recurring events in one
record and then, on request, create a temp table that contained all the
events for the given time frame. 

Thanks to everyone that help me with this problem!

Joe Rojas


-----Original Message-----
From: Drew Wutka [mailto:DWUTKA at marlow.com]
Sent: Friday, February 14, 2003 7:27 PM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] OT: Programming Logic

It's kind of odd that this has come up, right after Darren's thread of a
scheduler.  I started writing a scheduler that stored time slots as numbers.
You break the time slots down to be represented by the bits in a number.
Thus, for any given day, an appointment only takes up one record.  And to
'replicate' that same appointment, you can use a bitmask scheme to determine
if the appoint is repeated.

I am going to incorporate it into my new MiniCalendar, so I guess I'll have
to demo it then.

Drew

-----Original Message-----
From: Brett Barabash [mailto:BBarabash at tappeconstruction.com]
Sent: Friday, February 14, 2003 4:05 PM
To: 'accessd at databaseadvisors.com'
Subject: RE: [AccessD] OT: Programming Logic


Bit logic is pretty handy.  AND, when applied to 2 numerical arguments,
returns the common bits between the two.  For example, using your 84
example, type in the Debug window:

?84 And 1
0
?84 And 2
0
?84 And 4
4
?84 And 8
0
?84 And 16
16
?84 And 32
0
?84 And 64
64

Based off of our above process, we have determined that 84 consists of
4+16+64.

One area where this came in handy was with my lightweight security code,
which had an inherent many->many relationship.  One form can be available to
many groups, and one user may be a member of many groups.  I needed to
determine if there was a "hit" between the user's security credentials and
the authorized groups.  For example, if I had the following groups:

1: Managers
2: Sales
4: HR
8: Accounting

I might want to say that the form is only available to Accounting and
Managers, so it has a security level of 1+8=9.  Take the HR manager, for
example.  They would have a security level of 1+4=5.  Now, I said earlier
that AND returns back the common bits, so if it returns a non-zero value, we
have a hit:

?9 And 5
1

The HR manager isn't part of Accounting, but can view the form because they
are a manager!

Normally I wouldn't go into this much detail, but I have explained my
security code to coworkers about 3 times, so it's become kinda second nature
to me by now...


-----Original Message-----
From: Jim DeMarco [mailto:Jdemarco at hshhp.org]
Sent: Friday, February 14, 2003 2:53 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] OT: Programming Logic


Joe,  this came up while back so you'll probably find the answer in the
archives.

HTH,

Jim DeMarco
Director of Product Development
HealthSource/Hudson Health Plan


-----Original Message-----
From: Joe Rojas [mailto:JRojas at tnco-inc.com]
Sent: Friday, February 14, 2003 3:27 PM
To: 'accessd at databaseadvisors.com'
Subject: [AccessD] OT: Programming Logic


Hi All,

        I have seen in a couple of programs that use flags to set options
that work by giving a "binary" value, if you will, to each setting. For
example, the first setting has the value 1, the second 2, then 4,
8,16,32,64,etc. Then it will add up the values of the settings that have
been turned on. So if the 3rd, 5th, and 7th settings were turned on the
value would be 84 (4+16+64). The totaled value generated would be unique,
i.e. no two combinations of settings would produce the same totaled value.

        Here is the part that I get stumped on...how would one program a
function that would take a totaled value and "break it up" into the
individual values that made it up? For example, if given the value 84, it
would "break it up" as 4, 16, and 64.

Any ideas would be appreciated.

Thanks,
Joe Rojas





This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from HealthSource/Hudson Health Plan
(HS/HHP) that is confidential or privileged.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or use of the contents of this message is strictly prohibited.
If you have received this message in error or are not the named recipient,
please notify us immediately, either by contacting the sender at the
electronic mail address noted above or calling HS/HHP at (914) 631-1611. If
you are not the intended recipient, please do not forward this email to
anyone, and delete and destroy all copies of this message.  Thank You".
****************************************************************************
*******

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



This electronic transmission is strictly confidential to TNCO, Inc. and
intended solely for the addressee. It may contain information which is
covered by legal, professional, or other privileges. If you are not the
intended addressee, or someone authorized by the intended addressee to
receive transmissions on behalf of the addressee, you must not retain,
disclose in any form, copy, or take any action in reliance on this
transmission. If you have received this transmission in error, please notify
the sender as soon as possible and destroy this message. While TNCO, Inc.
uses virus protection, the recipient should check this email and any
attachments for the presence of viruses. TNCO, Inc. accepts no liability for
any damage caused by any virus transmitted by this email.



More information about the AccessD mailing list