Thanks Peter,

I have moved forward and can now pass a parameter to my called tcl 
script.  However I am still unable to create my own global.  Here is 
an extract from my header:


TCL puts {ZZZZZZZZZZZZZZZZZZZZZZ $(FME_MF_DIR)}
TCL2 set RwAdmin RichardW
TCL puts {XXXXXXXXXXXXXXXXXXXXXX $RwAdmin}
# Call script to log status in Oracle table
FME_END_TCL source {$(FME_MF_DIR)Test_FME_END.tcl} ; set  myVar 
$(FME_MF_DIR)


and from my tcl script:

puts {Printed from called tcl program $MyVar}


The output extract is:

Opened native MapInfo file `C:\MapTest\MyAggregateTest.tab'
ZZZZZZZZZZZZZZZZZZZZZZ C:\MapTest/
XXXXXXXXXXXXXXXXXXXXXX $RwAdmin

Translation was SUCCESSFUL (4 feature(s)/43 coordinate(s) output)
FME Session Duration: 1.5 seconds. 
Printed from called tcl program $MyVar


You can see that the pre-defined macros expand ok but the globals 
RwAdmin and MyVar do not work.  I think that it must be either the 
way I am defineing them or the way I am calling them that is wrong. I 
tried following your example.  Can you see what I am doing wrong.

Richard W







--- In [email protected], "peter laulund" <[EMAIL PROTECTED]> 
wrote:
>
> Hi
> 
> wheter your code is in the global namespace or in a proc you can 
use one off 
> these options
> 
> FME_END_TCL source {$(FME_MF_DIR)Test_FME_END.tcl} ; myProg 
$(macroName)
> 
> where you give the macro as a parameter to the proc starting the 
script
> 
> or you can just place the value in a global variable
> 
> FME_END_TCL source {$(FME_MF_DIR)Test_FME_END.tcl} ; set  myVar 
$(macroName)
> 
> you can use this syntax when starting any kind of tcl (FME_END_, 
INCLUDE [ 
> or Tcl2/TCL) as an exampel from a project i am working on right now
> 
> 
> Tcl2 set gsPath2App 
$(FME_MF_DIR_UNIX)/                                     
> ; \
>      set gsPath2Data [regsub -all -- {\\} {$(DestDataset)/
$(DestFormat)} 
> {/}] ; \
>      set dbf $gsPath2App/tcl/def/
$(Dataset)/felter.dbf                      
> ; \
>      catch { file mkdir 
$gsPath2Data }                                      
> ; \
>      source 
$gsPath2App/TCL/ATTRIBUT.TCL                                    
> ; \
>      source $gsPath2App/TCL/$(DestFormat)
_OUT.TCL                           
> ; \
>      source 
$gsPath2App/TCL/LIB/LANUTIL.TCL                                  
> ; \
>      main $(DestFormat)
> 
> Note: you have to sepperate the command with a ; and also note the 
use of 
> FME_MF_DIR_UNIX/ this gives a parth with / rather than \ allowing 
us to get 
> rid of the {} around the parth :-}
> 
> Peter Laulund
> 
> 
> >From: "RichardW" <[EMAIL PROTECTED]>
> >Reply-To: [email protected]
> >To: [email protected]
> >Subject: [fme] Macros,  Parameters & FME_END_TCL
> >Date: Tue, 20 Dec 2005 15:05:56 -0000
> >
> >Hi group,
> >
> >I am having trouble passing a parameter to a tcl script invoked by
> >FME_END_TCL.
> >
> >I have used Tools, Edit Header to include the following:
> >
> ># =================================================================
> ># Call script to log status in Oracle table
> >FME_END_TCL source {$(FME_MF_DIR)Test_FME_END.tcl}
> ># =================================================================
> >
> >
> >The Test_FME_END.tcl script logs the translation status in an 
oracle
> >table.  This works fine.
> >
> >Now I want to generalise the procedure so that the same tcl script 
is
> >used for each transform.  A parameter(s), eg administrator email, 
set
> >in the header will pass through to the tcl script which will be
> >logged in the database and used to trigger an email alert to the
> >appropriate administrator.
> >
> >I cannot figure out how to set a parameter in the header and pass 
it
> >to my tcl script.
> >
> >Can anyone help with this
> >
> >Thanks
> >Richard
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >Get the maximum benefit from your FME, FME Objects, or 
SpatialDirect via 
> >our Professional Services team.  Visit www.safe.com/services for 
details.
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> 
> _________________________________________________________________
> Del din verden med MSN Spaces http://spaces.msn.com
>








Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our 
Professional Services team.  Visit www.safe.com/services for details. 
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/
 



Reply via email to