opening a diferent card based on day of the week
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
opening a diferent card based on day of the week
I have a stack with 7 cards. I need a script that will look at the day of the week it is when the stack is opened, and go to a specific card based on that data. i have been trying to use the date function to get the data i need, but I have so far been unsuccessful. How can I sort the day portion of the data from the rest of the date?
Re: opening a diferent card based on day of the week
Hi Magice,
if i understand what you want this script should work
Best
Jean-Marc
if i understand what you want this script should work
Code: Select all
on openstack
GoCdTheDay
end openstack
on GoCdTheDay
put the long date into TheDate
put item 1 of TheDate into TheDay
put TheDay
open cd TheDay
end GoCdTheDay
Jean-Marc
https://alternatic.ch
Re: opening a diferent card based on day of the week
thank you, that put me on the right path. However it still has one unexpected problem in my situation. Each of my cards is tied to a tab menu group so I can switch "days" manually by clicking the tabs. The script changes each card, but the tab menus hilight doesn't follow.
I have tried the following script to rectify this:
(Group "Days" being my tab menu) I recieved an error that TheDay was not an integer
so I tried the following script:
but it isn't working either. Any idea how to get the Tab Menu to follow the cards the same way the cards follow the tab menu?
I have tried the following script to rectify this:
Code: Select all
set the hilitedButton of group "Days" to TheDay
so I tried the following script:
Code: Select all
if the value of TheDay = "Monday" then put 1 into tDayNum
else end if
if the value of TheDay = "Teusday" then put 2 into tDayNum
else end if
if the value of TheDay = "Wednesday" then put 3 into tDayNum
else end if
if the value of TheDay = "Thursday" then put 4 into tDayNum
else end if
if the value of TheDay = "Friday" then put 5 into tDayNum
else end if
if the value of TheDay = "Saturday" then put 6 into tDayNum
else end if
if the value of TheDay = "Sunday" then put 7 into tDayNum
else end if
put tDayNum
set the hilitedButton of group "Days" to tDayNum
Re: opening a diferent card based on day of the week
deleted by poster
Last edited by Mark on Sun Sep 05, 2010 9:30 pm, edited 2 times in total.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: opening a diferent card based on day of the week
Magice,
look at the menuhistory in the dictionary. You can switch the tab at the same time you switch to the card or you could just set where tDayNum is a number which corresponds to your Tab Menu. This switches to the card. So you would not issue a go to card x but just change the menuhistory of the Tab Menu. By the way you can also query the menuhistory of the tab menu to know which is the active tab.
regards
Bernd
look at the menuhistory in the dictionary. You can switch the tab at the same time you switch to the card or you could just set
Code: Select all
set the menuHistory of button "Tab Menu" to tDayNum
regards
Bernd
Re: opening a diferent card based on day of the week
Once again Bernd you saw past my poor descriptions got to the root of the problem.
Thank You
Thank You