Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
Dashboards (Read 36142 times)
BrianH
Full Member
*
Offline



Posts: 4

Re: Dashboards
Reply #15 - Mar 22nd, 2009, 6:31pm
 
I'm really interested in the Dashboard idea, but I'm running into trouble with setting up the "Random word" note. I've set everything up as suggested in the "Random word of the day" post on the blog, and it will grab the text ... and then change it every second, even though by the code it shouldn't change it if the date of the note is set to today (which it is). Any idea what's going on here? Running Tinderbox 4.6.1.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Dashboards
Reply #16 - Mar 22nd, 2009, 6:49pm
 
Looking back at http://www.markbernstein.org/Mar09/RandomWordOfTheDay.html, the  suggested rule says:
Quote:
if($Date!="today"){$Text=runCommand($command);$Date="today"}



This relies on a user attribute called $Date -- a place where we store the date of the most recent random word.  

Did you create an attribute called $Date?  Is it in fact a date attribute?  That's the most likely source of the problem.
Back to top
 
 
WWW   IP Logged
BrianH
Full Member
*
Offline



Posts: 4

Re: Dashboards
Reply #17 - Mar 22nd, 2009, 9:52pm
 
Yep, the variable's called Date (can't name it with a $, though I use it in the if statement), and my code is identical to the one you posted here. The if statement does change the value of Date to the current date and time, but it seems like the first part is being ignored.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Dashboards
Reply #18 - Mar 23rd, 2009, 4:33am
 
The '$' is a code syntax to show Date is an attribute, it is not part of the name and you should not be able to use it as the start of an attribute name nor (not tested) in a name.

The default data type for new attributes is 'string'. IOW, if you create a user attribute and just give it a name it will be string type unless you also set a different type. It's worth double-checking your 'Date' attribute is of 'date' type as you don't specifically reply to that question say in your last message. If it is string type, your random word's Date attribute value will likely be 'today' and not an actual date.
Back to top
 
« Last Edit: Mar 23rd, 2009, 4:34am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
BrianH
Full Member
*
Offline



Posts: 4

Re: Dashboards
Reply #19 - Mar 23rd, 2009, 10:44am
 
Sorry, forgot to mention that in my previous post - Date is indeed a "date" type attribute. I tried this out in a new Tinderbox file, just to be on the safe side, got the same behaviour.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Dashboards
Reply #20 - Mar 23rd, 2009, 11:03am
 
Why don't you send us your file?
Back to top
 
 
WWW   IP Logged
BrianH
Full Member
*
Offline



Posts: 4

Re: Dashboards
Reply #21 - Mar 23rd, 2009, 2:59pm
 
Email sent, thanks for your help!
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Dashboards: The Answe
Reply #22 - Mar 23rd, 2009, 5:27pm
 
In 4.6.1, != is subtly different from = with respect to dates

What you want is

     if(!($Date="today")) {....

which is true if the current value of $Date is not the same day as today.  In 4.6.1, "=" is true for dates on the same calendar say, but "!=" didn't get the memo and is still taking time into account.

Starting in 4.6.2, you'll be able to use != with the expected result.
Back to top
 
 
WWW   IP Logged
Pages: 1 2 
Send Topic Print