edudna Posted March 17, 2007 Posted March 17, 2007 How can we express z in this function to be any integer in order to be applied in the if function; Let([z=any integer]; If(Year(MyDate)=2004+4.z) Pascal
Søren Dyhr Posted March 17, 2007 Posted March 17, 2007 Let([z=any integer]; If(Year(MyDate)=Int(2004+Evaluate ( "4," & z ));"something";"something_else") substitute the , with a . if you use a "x-the-pond" notation in your OS-prefs! --sd
edudna Posted March 17, 2007 Author Posted March 17, 2007 (edited) Soren, Thank you for your reply but I mean something else I think in this formula. To analyze you more this is to cover the additional days of FEBRUARY in a function. If (Year(MyDate)=2004+m.4; 29; 28) I mean how to indicate all the years that have one day more in February instead to write 2008, 2012 2016 etc. This is why I need to use the multiplication of 4 in the formula but not just for one integer but for any integer that multiply 4. I hope you can understand. Pascal Edited March 17, 2007 by Guest
Søren Dyhr Posted March 17, 2007 Posted March 17, 2007 Case (Mod ( Year(MyDate) ; 4 );28;29) But isn't there something about year 2000 not being a leapyear??? Case(Mod ( Year ; 4 ) xor 0 + Mod(Year;2000) xor 0;29;28) --sd
comment Posted March 17, 2007 Posted March 17, 2007 1. 2000 WAS a leap year. Your formula also returns incorrect results for years 1900 and 2100, for example. I think the rules for the Gregorian calendar can be written as: Case ( Mod ( Year ; 4 ) or not Mod ( Year ; 100 ) and Mod ( Year ; 400 ) ; 28 ; 29 ) Of course, you could let Filemaker do the work for you, since it knows about leap years: Case ( Month ( Date ( 2 ; 29 ; Year ) ) = 3 ; 28 ; 29 ) 2. What does Case ( test xor 0 ; result ; defaultResult ) mean? How is it different from plain Case ( test ; result ; defaultResult )?
Søren Dyhr Posted March 17, 2007 Posted March 17, 2007 If you are putting up a series of conditions to point out various locations of a Choose( can a base-2 truthtable or mutliplexer be set up like this: Sign(Mod(theYear;4))+ 2^Sign(Mod(theYear;100))+ 4^Sign(Mod(theYear;400)) It's of course not quite the point in this case, but I do in this case use Value xor 0 instead of Sign( ...becasue I with my slight of dyslexia better can read this: (Mod(theYear;4) xor 0) + 2^(Mod(theYear;100) xor 0)+ 4^(Mod(theYear;400) xor 0) ...thats all! But you are right your filemaker near approach is a much better one: Case ( Month ( Date ( 2 ; 29 ; Year ) ) = 3 ; 28 ; 29 ) I guess this (still) has to do with enduring and perhaps sometimes even deserving teachers in greece, so your reservations here: incorrect results for years 1900 and 2100 ...are of less importance, taking the apocalyptic nightmares of Y2K in consideration, where people seeked shelter in the mountains of West Virginia with boxes of ammunitions, to prevent their expectations hitting them at first trombone blast. --sd
comment Posted March 17, 2007 Posted March 17, 2007 I see (I think) - you want to force a value to a Boolean result. But your method is giving ME dyslexia. In version 8 and above, you could simply use GetAsBoolean(). Or, in any version, you could make it: 2^not not value
Søren Dyhr Posted March 17, 2007 Posted March 17, 2007 I know, but I'm getting used to the xor'ing! --sd
Recommended Posts
This topic is 6522 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now