Great breakdown - just adding that in the terms of the documentation, the "right side" of the && operator in this case is "1". The = sign and everything after it is part of another operation and is not considered in this context.
Didn't realize that, sorry! I should have done more testing myself. I did some more research and found a way to do this in an object-oriented fashion: https://community.intersystems.com/post/get-property-maxlen
I've confirmed that this works on a 2024.1.1 instance with the following steps:
set cdef = ##class(%Dictionary.ClassDefinition).%OpenId("<class name>")
Set count = cdef.Properties.Count()
for i = 1:1:count {if cdef.Properties.GetAt(i).Name = "<Property Name>" {w cdef.Properties.GetAt(i).Parameters.GetAt("MAXLEN")}}
Following up on this from a recent customer conversation: the current best practices that we have settled on has been disabling exportselectivity as in Ben De Boe's post (https://community.intersystems.com/post/cicd-iris-sql), alongside ensuring AdaptiveMode is turned on (https://docs.intersystems.com/iris20243/csp/docbook/Doc.View.cls?KEY=RAC...). For now this will ensure that initially collected stats aren't overwritten, and once table statistics are collected automatically this should be completely "hands off".