Page 1 of 1

Case Sensitivity?

Posted: 2018-11-21 03:30:11
by ScottinPollock
Some aspects of the macro syntax are case sensitive (throwing an error), and others are not.

Why!?

Re: Case Sensitivity?

Posted: 2018-11-21 04:29:17
by phspaelti
Generally the rule is: Variable names, Menu Command names, as well as Object names along with their properties and commands are all case sensitive. Macro language keywords ('if', 'foreach', etc.) are not. I think the basic division is reasonable. The property and command names use a camelCase system that capitalizes every word (except the first letter after the period), but admittedly I always get stuck on things like .expandedFilePath (or is it .expandedFilepath?)

Were you bothered by something in particular, or just the whole system :lol:

Re: Case Sensitivity?

Posted: 2018-11-21 08:53:14
by martin
We could probably relax the case sensitive nature of some macro aspects. There's little reason to require "Document.active" and disallow "document.Active", or to cause Philip annoyance when he misremembers ".expandedFilepath" instead of ".expandedFilePath". Is this what's bothering you?

However it's extremely unlikely we'd change whether variable names are case sensitive. Not only because changing that now could impact existing macro code (imagine a macro that expects $doc and $DOC are two separate variables), but also because case-sensitivity is traditional for most programming languages when it comes to variable names.

Re: Case Sensitivity?

Posted: 2018-11-21 09:10:21
by ScottinPollock
martin wrote: 2018-11-21 08:53:14 We could probably relax the case sensitive nature of some macro aspects … Is this what's bothering you?
Yup, that would be great. I'm certainly OK with case sensitive on Vars and menu items.