10 Replies Latest reply on Mar 19, 2014 5:14 PM by carlo.m

# Parse Error

I am having an issue with the below calculation resulting in an Error Messages simply stating Parse Error. The field I am attempting to get the name of is from an unreleated table.

Has anyone experianced the issue?

Why does the calculation work when I break it down, but not as a whole?

Thanks

Silas

This results in the error.

Let([
n =GetFieldName(zConstants::Capacity_EmployeeHoursPerday);
p =Position ( n;":";0;1);
f =Right(n; Length(n) - (p+1 )) ;
t =Left(n; p-1)];

n &"¶"&

p &"¶"&

f &"¶"&

t
)

By removing the GetFieldName function and just making n equal what the function would have returned the calculation works as expected.

Let([
n ="zConstants::Capacity_EmployeeHoursPerday";
p =Position ( n;":";0;1);
f =Right(n; Length(n) - (p+1 )) ;
t =Left(n; p-1)];

n &"¶"&

p &"¶"&

f &"¶"&

t
)

The below also works

Let(
n =GetFieldName(zConstants::Capacity_EmployeeHoursPerday);
n

)

• ###### 1. Re: Parse Error

Is there a relationship between the Charting table and zConstants?

Or is the Capacity_EmployeeHoursPerday field a global field?

• ###### 2. Re: Parse Error

It is non global field from an unreleated table.

• ###### 3. Re: Parse Error

Well, the surprising thing here is that this =

Let(
n =GetFieldName(zConstants::Capacity_EmployeeHoursPerday);
n

)

works, instead of producing an 'unrelated table' error message.

• ###### 4. Re: Parse Error

Correct, however, it begins to fail when I add other variables to the let statement.

• ###### 5. Re: Parse Error

Yes, there is an inconsistency here that shouldn't exist. Perhaps it could even be called a bug. I also suspect "Parse error" is not a type of message we are ever supposed to see.

Still, a reference to a non-global field in an unrelated table is not supposed not work at all - so I suspect fixing this bug would not help you.

• ###### 6. Re: Parse Error

My hope is that the function is working correctly as it would be very helpful in creating ExecuteSQL queries that would not break if a table or field name were to be changed.

Thanks for taking a look Michael.

• ###### 7. Re: Parse Error

FM 12 ExecuteSQL: Robust Coding

Part 1 of 2 - http://www.filemakerhacks.com/?p=4924

AND

Part 2 of 2 - http://www.filemakerhacks.com/?p=5013

Beverly

My hope is that the function is working correctly as it would be very helpful in creating ExecuteSQL queries that would not break if a table or field name were to be changed.

1 of 1 people found this helpful
• ###### 8. Re: Parse Error

Thanks Beverly,

• ###### 9. Re: Parse Error

Michael Horak wrote:

Still, a reference to a non-global field in an unrelated table is not supposed not work at all ...

Strange indeed.  And a calculation with simply this:  GetFieldName ( Parent::Field ) with no relationship to Parent is accepted without error at all, in both 11 and 12.

Also a bit strange is when this child calc is placed on a parent layout, it displays <unrelated table> but when you click into the field, it displays 'Parent::Field'!

• ###### 10. Re: Parse Error

Has anybody tested this in FMP 13? Was the bug fixed?