Case Sensitivity?

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

Case Sensitivity?

Post by ScottinPollock »

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

Why!?
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Case Sensitivity?

Post 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:
philip
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Case Sensitivity?

Post 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.
User avatar
ScottinPollock
Posts: 36
Joined: 2017-09-11 08:16:47

Re: Case Sensitivity?

Post 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.
Post Reply