Hi Michael,
Ah, the joys of multiple parsers. In this case, we have both the FME
parser as well as the Tcl parser getting a crack at your line.
If you use this as your program:
FME_LogMessage fme_inform &message
Then the FME parser replaces the &message with whatever that value
was, and the Tcl parser will end up ignoring all the words after the
first one in the message because it the FME_LogMessage call thinks it
should only get 2 parameters.
Here's the problem with each of the quoting you tried:
> "&message"
FME's parser will get rid of the quotes before Tcl gets a crack at it,
so you end up with the same result as if there was no quotes.
> {&message}
} are valid characters for an attribute name, so its looking for an
attribute with } as the last character.
> '&message'
' are not honoured as quotes by any of the parsers involved. Again,
it ends up looking for ' as the last character of the attribute name,
and finds no attribute.
Mark was close when he suggested:
FME_LogMessage fme_inform (FME_GetAttribute message)
but the syntax he was looking for is:
FME_LogMessage fme_inform [FME_GetAttribute message]
This is the recommended way actually -- in this case, FME's parser is
NOT involved in any way, and we are getting Tcl to do all the work.
The [ ] enclose a function call that Tcl will run, which in this case
returns the result of getting the "message" attribute out of the
feature. That is passed as the second argument to the FME_LogMessage,
in its entirety. Using [ ] to nest function calls is a common Tcl
idiom.
Good luck!
Dale
> Thanks Mark for the tip ...
>
> I tried and the next problem I run into is with any blank space
> in the message. It ends with the first blank.
>
> My parameter line in TCL Caller is:
>
> FME_LogMessage fme_inform &message
>
> where "message" is the attribute holding the message.
>
> I can't seem to find a quoting method to bypass the blank space
> problem... I tried:
> "&message"
> {&message}
> '&message'
>
> ... seems my TCL insight is too small ...
>
> Michael
>
> --- In [email protected], "mark2atsafe" <[EMAIL PROTECTED]> wrote:
> >
> > Hi Michael,
> > The Logger won't do it, because the @Log() function only writes
> > feature info with the message.
> >
> > However - the @Tcl2() function is the one you need - and can be run
> > from the TCLCaller.
> >
> > In the TCLCaller set the TCL Expression to:
> >
> > FME_LogMessage fme_inform xxxx
> >
> > ...where xxxx is the message you want logging. Check the @Tcl2()
> > function in the FME Functions, Factories and Transformers manual
for
> > the different options that are available (eg call it ERROR or
WARNING
> > instead of INFORM).
> >
> > Good question - I didn't realize you could do this until I checked
> it out.
> >
> > Regards,
> >
> > Mark
> >
> > Mark Ireland, Senior Product Specialist
> > Safe Software Inc. Surrey, BC, CANADA
> > [EMAIL PROTECTED] http://www.safe.com
> > Solutions for Spatial Data Translation, Distribution and Access
> >
> >
> > --- In [email protected], "mhabarta" <mhabarta@> wrote:
> > >
> > > Hallo
> > >
> > > Anybody has an idea, how to write a message to the FME LOG ?
> > >
> > > LOGGER writes a feature to the log, but I want to write a text
message
> > > to the LOG.
> > >
> > > Thanks Michael
> > >
> >
>
>
Join us at the FME Worldwide User Conference Sept. 21-22, 2006 Vancouver BC
Canada. For more information, visit www.safe.com/2006uc.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/fme/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/