On Fri, 7 Jun 2013, Artur Tarassow wrote:
in the past the following worked, but it does do so in the recent
version
anymore:
<hansl>
smpl 1972:1 1978:3
string first = "1972:1"
string last = "1978:3"
scalar Tdiff = 2
smpl @first @last-Tdiff
<\hansl>
The old behavior was due to an undocumented hack whereby a date
string such as "1978:3" could be used "as is" in arithmetic. This
was just too sloppy and it has been discontinued. If you want to use
a date in arithmetic you have to convert it to a proper scalar via
the obsnum() function.
In principle, your command
smpl @first @last-Tdiff
should work if rephrased as
smpl @first obsnum(last)-Tdiff
but this didn't work because the internal string variable to hold
the sample limit was too small so that "obsnum(last)-Tdiff" was
getting truncated. That's now fixed in CVS. However, it's much more
elegant to use the increment or decrement form of the smpl command
for this sort of thing.
Allin Cottrell