tags:

views:

71

answers:

1

In FitNesse, can variables be defined in terms of other variables?

I want to do the equivalent of:

    int a=3;
    int b=a;

To make this concrete, I have a variable defining the date:

    !define clock.date {2/2/2009}

I then want to define some other variable ${other.date} based on it, something like:

    !define other.date {=${clock.date}=}

However, this doesn't work. Is there any way to do this?

+1  A: 

The current parser has an issue with nested braces so you can use the alternate syntax for define:

!define x {stuff}

!define y (${x})

This restriction will be removed soon and you'll be able to do !define y {${x}} etc.

Mike Stockdale
I'm pretty sure I tried this (since it's an obvious thing to do) but it failed. However, we're on a pretty old version of FitNesse.Gonna mark this as accepted ... thanks!
Dan Haywood