Use the new PageStyle
datatype instead of page style string literals
#805
rvanbekkum
started this conversation in
New Rule
Replies: 1 comment 1 reply
-
Great idea! I've created this rule, but I'm unsure if it will result in many false positives, particularly due to the PageStyle values 'Standard', 'Strong' and 'None.' Validating whether the string literal is consistently passed to a StyleExpr property of a field seems challenging. What do you think? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If runtime 14.0 or newer is used (BC25.0 or newer), then check for any occurences of string literals
'Unfavorable'
,'Favorable'
, ... (and all other supported page styles).Raise a diagnostic on the string literal and suggest to use the new
PageStyle
datatype instead (e.g.,PageStyle::Unfavorable
).Also raise the diagnostic for
Label
variables likeLabel 'Unfavorable', Locked = true
Adopting the use of the new
PageStyle
datatype allows to more easily get the supported pagestyles via IntelliSense and avoids incorrect behaviour when a typo is made in hardcoded strings or label variables.Unfortunately the
StyleExpr
property on page controls still only accepts strings (or booleans), so a conversion to a string will still be needed, e.g.,Format(MyPageStyleVariable)
Content of this idea might also be good for alguidelines.dev
Beta Was this translation helpful? Give feedback.
All reactions