On Wednesday, March 28, 2001, at 05:28 PM, Harald Fernengel wrote:
> Hello,
>
> Parsing the field instructions is a total nightmare. As I found out
> different
> versions of Word produce different field instructions for the same
> field.
That's why I am asking.
> As far as I know there doesn't exist a documentation for field
> instructions.
>
> This is what happens when you insert a datefield in StarOffice and save
> it as
> RTF:
>
> {\field
> {\*\fldinst \\date \\@"tt.MM.yy"}
> {\fldrslt 28.03.01}
> }
>
> Do you notice the double backslash? This isn't valid RTF code, this is
> Word's
> macro language. (If you want to insert a backslash, for example in a
> Filename, you have to use \\\\ ). BTW, inside the \fldinst block there
> can be
> other subblocks, for example if you use the "if" macro...
\\ is valid in RTF. It is an escape sequence for \
This means that we should interpret \date to "execute" the field code.
The problem is that the rtf specifications show other example that does
not really match this syntax.
>
> I suggest writing a new Class for parsing field instructions, because
> they
> are rather an own language and not RTF specific stuff. Perhaps we can
> reuse
> this class if M$ creates a new file format?
After investigating a little bit more, I suspect field instruction to be
based on Word's own field instruction. Dom, do you confirm ? If this is
the case, I'll be forced to use wv in RTF import for this matter.
On the other, I have found that StarOffice is really dumb exporting RTF
files as it put images as saparate file and put a \field with the image
filename in the field instruction....
And these files are JPEG (not currently imported by AbiWord)
Thanks for the tip Harald.
Hub