[thelist] ASP - if x = every nth?

Luther, Ron Ron.Luther at hp.com
Thu Jun 7 09:31:42 CDT 2007

Two kinds of people run into Modulo arithmetic: 
those who 'get' it, and those in the remainder.

Heh.  Sorry.  Had to get that out of my system.


<tip author="RonL" type="calculation ideas"

One productive way to spend some free time is to read thru 
the documentation for your language du jour! You usually find 
some interesting tidbits - even on your nth reading.

For calculations, it's always helpful to run through some 
tests to make sure you understand how the operator works 
and what the various required and optional parameters do. 

Nesting different functions can add quite a bit of power 
to your code as well.

Finally, be open to 'interesting' ways to abuse canned 
calculations. Sometime (though I will admit they CAN be 
difficult to read at times) multiplication by a logical 
expression, like 'y * (x>5)' or (for more fun) 'Select 
Price + .1 * sgn(DateDiff(Month(Date_1), Month(Date_2))) 
as Adjusted_Invoice_for_Early_Or_Late_Prior_Payment From 
Table_1', can give you a nice performance gain over 
alternative solutions.  

[It is best to document anything 'odd' that like in your 
code.  Let's be polite to the next person to try to fiddle 
with it.]


More information about the thelist mailing list