lonesomejubilee Posted October 22, 2005 Posted October 22, 2005 Hi, I am trying to make a splash screen that will display the user name, a greeting, maybe a picture and a message... I am trying to use a calculation like this: Case ( Get(CurrentTime) > Time (4;0;0) and Get(CurrentTime) < 16;0;0); "Good afternoon" And it works, but when it gets within the hour it doesn't work. In other words as soon as I get within the hour of the late parameter, it doesn't work. What am I doing wrong? And how can I do this with a username? Is there a Get(currentuser) type of calculation? I want to do it based off of the user log in (for us it is an id number) I thought this would be easy, but I guess nothing ever is. Or I am just dumb... Vandy
Kent Searight Posted October 22, 2005 Posted October 22, 2005 Try this example. If you take a look at the script it'll make sense how everything works. Login as "Vandy", the password is "password" Have fun! splash.zip
CyborgSam Posted October 22, 2005 Posted October 22, 2005 Vandy-> If I'm reading the problem right, the Time ( 16 ; 0 ; 0 ) needs to be Time ( 16 ; 59 ; 59 ) to catch all times from 4PM but less than 5PM.
CyborgSam Posted October 22, 2005 Posted October 22, 2005 Kent-> You posted while I was composing mine! Your splash example's calc has an issue (I'm sure this is an oversight, since it's late in the day) Case ( Get ( CurrentTime ) < 12 ; "Good Morning" ; Get ( CurrentTime ) < 18 ; "Good Afternoon" ; "Good Evening" ) The 18 will be interpreted as 18 seconds, not 18 hours. The 18 needs to be either Time ( 18 ; 0 ; 0 ) or expressed in seconds (18*3600).
comment Posted October 22, 2005 Posted October 22, 2005 Filemaker time is the number oof seconds elapsed since midnight. Therefore your calculation: Case ( Get ( CurrentTime ) < 12 ; "Good Morning" ; Get ( CurrentTime ) < 18 ; "Good Afternoon" ; "Good Evening" ) will return "Good Morning" in the first 12 seconds after midnight, "Good Afternoon" in the following 6 seconds, and "Good Evening" for the rest of the day. Since Vandy does not seem to be interested in minutes and seconds, you can get the desired result by: Let ( H = Hour ( Get (CurrentTime) ) ; Case ( H < 12; "Good Morning" ; H < 18 ; "Good Afternoon" ; "Good Evening" ) )
Recommended Posts
This topic is 7235 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