v Main
-> Latest
-> About
-> Photos
-> WebCam
-> Words
-> Graphics
-v RISC OS
-> AMPlay
-> SpriteUtils
-v Recurse
-> BitField
-v Diary
-v Macros
-> Options
-> Scripts
-> History
-> Fan
-> Icons
-> Music
-> Links
-> Credits


> Site Map
-

 Diary 


Macros

RISC OS applications have a built in standard for referring to date and time information. This is detailed in the RISC OS 3 (and presumably later) manual, as part of the documentation for the Alarm application. Organizer also supports this format, as may other RISC OS applications.

Diary currently supports some of it, but not all, as we'll see below. It also has a few additions of its own, some for convenience, and some for necessity as it needs to encode information other than the date.

First, the list of RISC OS macros:

NameMeaningTypical valueSupported by Diary?
%se
seconds59N
%mi
minutes05Y 1
%12
hours in 12 hour format07Y 1
%24
hours in 24 hour format23Y 1
%am
or
%pm
'AM' or 'PM'PMY 1
%we
weekday in fullSundayY
%w3
weekday in three charactersSunY
%wn
weekday as a number7Y
%dy
day of the month26Y
%st
appropriate suffixthY 2
%mo
month name in fullMarchY
%m3
month name in three charactersMarY
%mn
month as a number3Y
%ce
century as two digits20Y
%yr
year within century00Y
%wk
week within year12Y 3
%dn
day within year86Y
%tz
timezoneGMTN
%0
insert a null character-N
%%
insert a percentage sign%Y 4

1: Time macros always return the current time, are only useful in certain circumstances - creating a new entry, setting a last modified date etc. Don't use them in loops - it doesn't work.
2: This returns the suffix appropriate to the most recently used numeric value.
3: Week 1 is taken as the week which commences with the first Monday in January.
4: Also, '%' on its own will insert a '%' as long as it doesn't form part of a recognised macro.

In addition to the above named macros, RISC OS also includes support for a modifier prefix, 'z'. This has the effect of removing any leading zero(es) from a numeric value. It only affects the macro which contains it.

As an example;

%we the %dy%st of %mo
might be
Monday the 06th of March

whereas, with the 'z' modifier;

%we the %zdy%st of %mo
would be
Monday the 6th of March

Still with me?

In Diary, the 'z' modifier can be applied to most numeric values - day of year, week of year, hour etc, but not year, century etc.

Additional macros that Diary uses;

NameMeaningTypical value
%cn
century as four digits2000 1
%ye
year as four digits2000 1
%ec
name of current diary entryvaries
%en
name of next diary entryvaries
%ep
name of previous diary entryvaries
%ef
name of first diary entry in current monthvaries
%el
name of last diary entry in current monthvaries
%ve
!Diary's version string0.06 1.5.2000

1: These macros have been added to make it simpler to refer to four digit years. Currently the century and year are identical, but next year the year will change while the century will not.

The '%e?' macros return the name of the relevant entry - whether it gives names or numbers, and whether it has leading zeroes or not will depend on the journal naming options in the options file.

Additional modifiers that Diary supports;

The additional modifiers are 'u' and 'l'. These have the effect of forcing the output to entirely UPPER or lower case as appropriate. The default for all the text output is Leading Capitals, except for the suffix, which is lower case unless you use the 'u' modifier.

The macros themselves are not case-sensitve - %we and %WE are equivalent.


< Diary. ^ Top.


Valid HTML 4.01 Copyright © 2006 Mike Sandells.
Last Modified: 12.7.2006