June 7, 200619 yr Hi all I would like to create a script to calculate the time of day in order to display a "good morning," "good evening," "good afternoon" message. Has anyone seen a similar script out there?
June 7, 200619 yr You could do a calculation, I believe, unstored: Case ( Get(CurrentTime) >= "0:01" and Get(CurrentTime) <= "12:00" ; "Good Morning"; Get(CurrentTime) >= "12:01" and Get(CurrentTime) <= "5:00" ; "Good Afternoon"; Get(CurrentTime) >= "5:01" and Get(CurrentTime) <= "11:59" ; "Good Afternoon"; ) I think that should do it :
June 7, 200619 yr There are various methods you could use, and I don't know if you want to display a dialog or use a field or what, but here's one way of setting up the calc: Let( [ noon = Time ( 12 ; 0 ; 0 ) ; cocktail = Time ( 6 ; 0 ; 0 ) ; now = Get ( CurrentTime ) ] ; Case( now < noon ; "good morning" ; now < cocktail ; "good afternoon" ; "good evening" ) )
Create an account or sign in to comment