Select to view content in your preferred language

Arcade Comment "//" and Line Spacing Issue

205
0
07-24-2024 05:13 PM
VinceE
by
Frequent Contributor

I'm experiencing an issue where lines following a single "//" line are causing Attribute Rules to throw errors when trying to save them. The code below is essentially meaningless, but I can reproduce this exact issue in much larger scripts.

This will not save, and throws the error shown (Object not found feat, Script line: 2).

 

//
var feat = $feature
return feat

 

VinceE_0-1721866030765.png

This, however, saves as expected without any issues:

 

//

var feat = $feature
return feat

 

Seems like in the first example, that commented out first "//" line is ALSO consuming/commenting out the variable assignment on the following Line 2, and therefore the variable object is not found.

I understand there isn't necessarily a good reason to use "//" to comment out a blank line, but I'm curious if this is expected behavior for some reason. Why would adding in an extra blank line make the difference?

Thanks!

0 Replies