Hello.
I was trying to find a good use for the macro syntax that I seem to
have overlooked: the %paranthesis("syntax"), so to speak.
It seems that the parantheses are evaluated AFTER the quotes. And,
without quotes, only the first word of the parantheses content is
used, for single-parameter macros anyway. And, the rest of the whole
parantheses construct is dropped, then. These are all
counter-intuitive behaviours.
%WRAPPED(%COOKIE("C:\file.txt"))
should do what it says. %COOKIE should take a string as input, and
return a string as output. If it returns a multi-word line, the result
is as if the macro looked like this:
%WRAPPED(This is my smart cookie line)
... and it works like this:
This is my smart cookie line)
- "This" seems to be wrapped, okay, it's a single word, the wrap is
not seen. But the ) after "line" shows that "is my smart cookie line)"
was treated literally. I would expect the macro to complain about a
bad syntax, if not assume it had "" around the string.
So, another approach.
%WRAPPED("%COOKIE("C:\file.txt")")
result:
(C:\file.txt")")
Uh, what? I can't even begin to understand how this happens.
So, in the end, I have to write my macro as this:
%WRAPPED("%COOKIE(""C:\file.txt"")")
But if the parantheses do not separate the quotes, so that
multi-quoting is still necessary, they're pretty much useless.
The correct grammar to be introduced, would be, IMO, like the one
below. Easy to parse, non-ambiguous...
<macro> := <macroname>
|
<macroname> "(" <parameter> <moreparameters> ")"
<macroname> := "COOKIE" | "OTIME" | ......
<parameter> := "\"" <string> "\""
|
<safeword>
<moreparameters> := ""
|
"," <string> <moreparameters>
<string> := <word>
|
<word> " " <string>
<word> := [^ ]*
<safeword> := [^ )]*
--
|\ /| \~~~/ \~~~/
| \/ | /\ > < \~/ > < ICQ# 3146019
|____| /__\ /___\ /_\ /___\ IQ# 3.14159
Co dzieciaki w zeszytach wypisują: "Poprzez pasanie gęsi i świń
doszedł do oświaty."
________________________________________________________
Current beta is 3.0.2.1 Beta/1 | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html
IMPORTANT: To register as a Beta tester, use this link first -
http://www.ritlabs.com/en/partners/testers/