Forum OpenACS Q&A: Response to syntax error in expression "2000 + 1 - "

Collapse
Posted by Dan Wickstrom on
It looks like $birthyear is undefined.  Try modifying birthdays.tcl as follows:
<br>
<pre>
  if { ![empty_string_p $birthyear] } {  # <-- change != to use empty_string_p function
    if { $before_or_after_today == "0" } {
        set age_on_next_birthday [expr $this_year - $birthyear]
        append html " (turns $age_on_next_birthday today!)"
    } elseif { $before_or_after_today == "-1" } {
        set age_on_next_birthday [expr $this_year - $birthyear]
        append html " (turns $age_on_next_birthday)"
    } else {
        set age_on_next_birthday [expr $this_year + 1 - $birthyear]
        append html " (turns $age_on_next_birthday)"
    }
    }

</pre>