On Tue, 24 Jan 2017, Allin Cottrell wrote:
On Tue, 24 Jan 2017, Artur T. wrote:
> The error message when calling tscvrol() is:
>
> <output>
> --dynamic: inapplicable option
> *** error within loop in function tscvrol
>> fcast ($t2+1) ($t2+b.nhor) --dynamic
Commands (as opposed to functions) are not generally equipped to handle
arbitary expressions such as the above. Try using string substitution and see
if that works:
string ft1 = sprintf("%d", $t2+1)
string ft2 = sprintf("%d", $t2+b.nhor)
fcast @ft1 @ft2 --dynamic
Sorry, that was not a good suggestion on my part. String substitution
is generally a last resort and it's not needed in this case, since
commands are supposed to accept scalar variables in place of numerical
constants. My revised recommendation here would be:
scalar ft1 = $t2 + 1
scalar ft2 = $t2 + b.nhor
fcast ft1 ft2 --dynamic
I gather that your original version,
fcast ($t2+1) ($t2+b.nhor) --dynamic
worked OK once you sorted out the "dynamic" issue, but you "got lucky"
in that respect. Such expressions are fragile in a command context.
For example if you inserted spaces
fcast ($t2 + 1) ...
the parsing would fall apart. (And I don't consider that a bug,
because commands generally expect space-separated arguments.)
Allin