Date Objects and macros

Get help using and writing Nisus Writer Pro macros.
Post Reply
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Date Objects and macros

Post by phspaelti »

The Nisus macro language has a date object construct. Unfortunately there is no easy way to create new date objects (except for 'now' objects). I am posting a package of macros with the principal one being a Make Date Object helper macro. This macro allows the user to specify a date as a string of the form "YYYY/MM/DD" and then get an object with that date. The other macros are mainly intended as sample to show things one might do with such objects.
Hope they are useful.
Attachments
Date macros.zip
(19.83 KiB) Downloaded 681 times
philip
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Date Objects and macros

Post by martin »

Thanks for sharing Philip! Although I must say, having any macro author (or more generally, any programmer) parse date strings is a great horror; really these tasks should be provided by the language, framework, or system. I apologize that you wrote this code :P

It is true that NWP macro Date objects can't easily be created for arbitrary points in time. However, the macro language does give you access to date information when useful, eg: the time a comment was made, file modification date, etc. But I understand the desire to create arbitrary dates as well– perhaps for matching comments or some such task. I'll file an enhancement.
Post Reply