Allin Cottrell schrieb:
On Thu, 12 Apr 2007, Allin Cottrell wrote:
>> ? string jojo = "@userdir"
>> Syntax error in command line
>> ? string jojo = @userdir
>> Syntax error in command line ...
>> Bug or feature?
> Bug, I'd say.
To be more precise, only the first of the above is expected to
work, since a string literal needs quotes around it. The odd
thing is that here it _does_work:
? string jojo = "@userdir"
Saved string as 'jojo'
? print "@jojo"
/home/cottrell/gretl/
I guess it has to do with the backslashes on windows, especially the
'\"' that comes out in the end (this time in German, but still evident):
? print "@userdir"
C:\openprogs\gretlwork\
? string jojo = "@userdir "
Saved string as 'jojo'
? string jojo = "@userdir"
Syntax-Fehler in Befehlszeile
?
But I'm afraid the trailing space cannot be used as a workaround in many
cases. Actually AFAIK Windows can also digest forward slashes internally
as path separators, so maybe that would be the way to go instead of
fixing the complicated parsing? Or double backslashes?
In general I must say I don't quite understand the need to have both the
@-escape *and* enclosing double quotes for a string variable. Well I
understand it after you've given the macro explanation, but it certainly
feels strange and in this particular case will cause you headaches...
-sven