Hey Bryan,
I ran into a similar problem awhile ago. I believe the problem has to
do with the FME failing to dereference any variable declared as zero.
Since the user is not permitted the option of specifing a data type,
the FME appears to treat attributes with zero as null (re C programming
You should to try to do a simple TCL work-around that explictly
returns/specifies a 0.0 in the event that the FME fails to produce
your zero. In this case, you will make the following modifications:
1. Create a functions.tcl file in the same directory as your .fme file
2. Enter the following code into the functions.tcl file:
#start
proc isZero{ {inOne 0} } {
global FME_Attributes
if { $inOne == 0 } {
return 0.0
}
return $inOne
}
#end
3. Save that file.
4. Enter the following line at the top of your FME script:
TCL source "\"$(FME_MF_DIR)functions.tcl\""
5. Replace your @Evauluate expression to the following, making sure
to replace a,b,c,d with the names of the variables that you are using:
@Evauluate((@TCL("isZero &a") / @TCL("isZero &b")) - (@TCL("isZero
&c") / @TCL("isZero &d")))
Semantics:
FME will exceute the evauluate statement. During its execution it
will dynamically execut the TCL isZero functions with the specified
variables. In the event that a,b,c or d is zero, the FME will simply
call the isZero function with no arguments.
isZero executes, and explictly returns 0.0 in the event that either a
0 is given to it, or in the event that no arguments are given to it.
@Evaluate will execute without any errors, providing that you do not
attempt to divide by zero.
-Clint
--- In [email protected], "Bryan Waller" <[EMAIL PROTECTED]> wrote:
>
>
> Hi Group,
>
>
> I am not sure if this is my problem or not.
>
>
> When I use the DecimalDegreesCalculator and one of the attributes
> (usually the minutes or seconds) is 0 the calculator fails with this
> error:
>
>
> @Evaluate -- failed to evaluate expression `expr -(/60.0)-(/3600.0)'
> -- syntax error in expression "-(/60.0)-(/3600.0)": unexpected
> operator /
>
>
> Any suggestions on how to avoid this or is it a problem?
>
> Thanks in advance.
>
>
> Bryan
>
>
>
>
> Bryan Waller, GIS Data Coordinator
>
> Midwest Surveys Inc.
>
> [EMAIL PROTECTED]
>
> ph.403.735.9344 (direct)
>
> ph.403.244.7471 (main)
>
> ph.403.830.6517 (cellular)
>
> fax.403.244.2466
>
> [2]www.midwestsurveys.com/
>
>
> 50 Best Employers
>
> References
>
> 1. mailto:[EMAIL PROTECTED]
> 2. http://www.midwestsurveys.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/