Case Sensitivity?

Get help using and writing Nisus Writer Pro macros.
Post Reply
User avatar
ScottinPollock
Posts: 29
Joined: 2017-09-11 08:16:47

Case Sensitivity?

Post by ScottinPollock » 2018-11-21 03:30:11

Some aspects of the macro syntax are case sensitive (throwing an error), and others are not.

Why!?

User avatar
phspaelti
Posts: 956
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Case Sensitivity?

Post by phspaelti » 2018-11-21 04:29:17

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:
philip

User avatar
martin
Official Nisus Person
Posts: 4384
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Case Sensitivity?

Post by martin » 2018-11-21 08:53:14

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.

User avatar
ScottinPollock
Posts: 29
Joined: 2017-09-11 08:16:47

Re: Case Sensitivity?

Post by ScottinPollock » 2018-11-21 09:10:21

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.

Post Reply