Parsing Error: Expression too long to be parsed.

4 posts / 0 new
Last post

Hi Friends,

I have encountered an expression evaluation error that would seem pretty self-explanatory on the surface:
[cid:image004.png at 01D35D3E.2C04E470]

After a couple passes to do the logical thing and reduce the line count and character count in the expression (trimming whitespace, removing annotations), I realized a mistake where I used #L instead of #LR for a reference to C-ACTIVITY-DESC.

Trimmed Example - the highlighted characters should read #LR:
switch(#SV(#PS()))
case 1 : 38800.32*#L("SPACE","AREA")/10260.77 $Exh*Area/Total Unit Area
case 2 : 27584.18*#L("SPACE","AREA")/7294.65 $Exh*Area/Total Unit Area
case 3 : 33622.74*#L("SPACE","AREA")/8891.55 $Exh*Area/Total Unit Area
case 4 : 12621.09*#L("SPACE","AREA")/3337.66 $Exh*Area/Total Unit Area
case 5 : 8551.12*#L("SPACE","AREA")/2901.15 $Exh*Area/Total Unit Area
case 7 : 18717.66*#L("SPACE","AREA")/6350.37 $Exh*Area/Total Unit Area
case 8 : 8066.63*#L("SPACE","AREA")/2899.83 $Exh*Area/Total Unit Area
case 10 : 24826.83*#L("SPACE","AREA")/8924.85 $Exh*Area/Total Unit Area
default : no_def
endswitch

Fixing that function, unintuitively, caused the above "expression too long" error to go away!

This however raises a couple questions - I'd be sincerely interested to see any replies or thoughts around either prompt:

1. I didn't think there was a limit for expression length (or at least a practical limit). The existence of this error suggests otherwise. To avoid crossing that line and to better interpret these errors in the future: Does anyone know what the actual character/line/other limits are for expression length?
* For reference, after trimming this was a relatively hefty expression clocking in at 2737 characters and 73 lines, according to my text editor... so if there is a limit it would be above those figures since it's now working again.
2. To further help interpret/troubleshoot similar situations in the future... Why would using #L (which I would think should resolve in an error along the lines "you're using the wrong function here, dummy") trigger an expression length error? Is there a hierarchy of error messages that maps out "throw error X before checking for root cause Y," that we could construct and keep as a reference for interpreting what different expression evaluation errors could mean when they come up?

Thanks everyone!

~Nick

[cid:image002.png at 01D35D3B.BED9BA30]
Nick Caton, P.E., BEMP
Senior Energy Engineer
Regional Energy Engineering Manager
Energy and Sustainability Services
Schneider Electric

D 913.564.6361
M 785.410.3317
F 913.564.6380
E nicholas.caton at schneider-electric.com

15200 Santa Fe Trail Drive
Suite 204
Lenexa, KS 66219
United States

[cid:image003.png at 01D35D3B.BED9BA30]

Nicholas.Caton at schneider-electric.com's picture
Joined: 2016-02-26
Reputation: 0