Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Enhancing "if" conditionals

It seems as though the if statement can only use "blank" or "nonblank" as the condition upon which the if statement operates.

I would like to be able to compare two variable in order to drive the display, for example:

Filed: {$ .filedDate $}
{$ if not(.filedDate = .modifiedDate) $}Updated: {$ .modifiedDate $}{$ endif $}

In other words, just display the "Updated" info if the date is different.  I don't think this is currently possible (but I'd be happy to be informed otherwise...)



Scott Blanksteen
Thursday, August 7, 2003

You are correct, Scott.  There is not a real "If" statement in CityDesk.

Your not alone in your desire for this feature.  I would kill for a few more scripting features.  We can only hope that the next release after 2.0 will beef up the scripting.  A simple If capability, or just the ability to keep a simple loop counter variable would save me so much headache.  I would like much much more than that (as I described in a previous post), but if we could get just those two little features, what a help that would be.

I am 80% very happy with CityDesk, but the extra hoops I've had to jump through with my site development because of the lack of certain scripting features have given me something of a headache.


Daniel Read
Thursday, August 7, 2003

I'll add to that CD's inability to use CS in its current {$ for each $} condition. uhrg.

john doe
Friday, August 8, 2003

I have to agree. After creating a few sites using CD I'm starting to get very frustrated at the lack of a true scripting language. There are just too many things I want to do that are next to impossible with CityScript in its current incarnation.

Saturday, August 9, 2003

Yep, I have to agree.

For example when creating a set of nav links, often I want to show the current page in the list of links but I want it displayed in a different style or not as a link at all (just formatted text).  Right now I just iterate through and create the list of links, and do fixup on the client side upon load using a small blob of javascript.

Typically that fails in NS 4.x (die Netscape, die already!  LOL) even with a lot of clever attempts to accommodate the "layered" world.

It still may be possible in CS, but maybe I haven't found just the right "recipe" yet?  I came close in 2.x but it involves rearranging the list of links on each page, showing the current page's "link" either 1st or last in the list.

Bob Riemersma
Tuesday, August 26, 2003

*  Recent Topics

*  Fog Creek Home