[addDays ^|a.a|=D|date d|days m|months y|years]

adds the specified number of days, months and years to an SQL formated date, returning it into ^|a.a|

[age ^|a.a|=b|born d|date]

Returns the age of a person born on b| on date d| – all dates SQL format

This is the default command so [formats ^|a.a|=^|a.b|] is the same as [^|a.a|=^|a.b|]
if no destination is included then the result is sent to ‘output’

Non-formated examples
[^|a.a|=^|a.street|}R^|a.town|] outputs the contents of ^|a.street| on one line and ^|a.town| on the next
Escape Codes ‘}’

R = new line
T = tab
– = backspace
D = delete
( = open square bracket
) = close square bracket
} = } e.g. }} translates as }
B =
P = |
Q = =
H = ^
q = ”
a = ‘
G = >
L = <
E = · (not currently used)

Formated examples – NB any line with at least one formated example removes all spaces.
=^(FVR)|a.hat| would output the value of ^|a.hat| followed by a new line
Codes that can be included within the ()
F – forced – will output the result even if there is no value
U – uppercase – output is all uppercase
L – lowercase – output is all lowercase
C – capitalised – Output words all start with a capital letter
c – value is currancy, so 1.2 will be formated as £1.20 (c must be before V)
X – safe HTML – escapes output to be safe
V – the value of the hat
P – padding – adds spaces to make result a certain length
e.g. when V= 12345 P10V = ‘     12345’ & VP10 = ‘12345     ‘

A – ascii – outputs character from asciss code e.g. A65 = A
S – spaces – S10 is 10 spaces
J – jump – J50 is jump to position 50 in the line – if already past that it does nothing
any non-formated escape letter is translated, e.g. R is a new line
.words. – adds the text between ‘.’

Ouputs the right hand side as a pretty print json string

[left ^|a.a|=V|value n|chars]
trims the value of V| to the number of chars e.g. [left=V|123456 n|3] gives 123

a negative n trims up to that number from the right e.g. n|-1 trims the last character of the right

[lines ^|a.a|=some text]
returns the number of lines of text

[makedate ^|a.a|=d|date f|format]

Translates an SQL date to a specific format. Codes are:
Dd – day number as integer
DD – day number as 2 digit number
ddd – first 3 letters of day e.g. Mon
day – day in full e.g. Monday
xx – suffix for day e.g. th for the 4th
Mm – month as an integer
MM – month as a 2 digit number
MMM – first 3 letters of month e.g. Jan
MMMM – month in full e.g. January
YY – last two digits of year e.g. 16 for 2016
YYYY – year in full

and other characters included are output as is e.g. f|DD-:-MM'(year)’YYYY would equal 23-:-04′(year)’2016

[maths ^|a.a|=^|a.b| * ^|a.c| ~p|2]

Does a mathematically operation on 2 numbers. Format must be: number space operator space number
operators can be +, -, /, * ,%
if ~p| is used then the result is limited to that number of decimal places, default 0

[mid ^|a.a|=V|^|a.b| n|start at l|length]

Outputs a substring of the V| starting at character n| and for l|chars

[posins ^|a.a|=V|^|a.b| s|string ~n|from index]

return the index of the start of the first occasion of s| in V|. ~n|index, finds next from that index

[printLabels=v|labels c|3 r|7 a|A4 m|10 o|p l|10]

v| list containing label text (multi-line)

c| columns

r| rows

a| page size (only A4 at the moment)

m| margins in mm

o| orientation p or l

l| lines per label – effects font size.

[ptime ^|a.a|=^|a.b| + ^|a.c|]
or
[ptime ^|a.a|=^|a.b| ~t|H]

When 2 times are passed then you can add or subtract to reach another time. Both input times and output can include hundredths e.g. 12:25:56.45
When only one time is passed, with no options, it expects a value of hundredths, and it returns a time. If ~t|H is included the input is a time and the output hundredths

[random ^|a.a|=s|10] or [random ^|a.a|=n|10]

returns a random string of length s| or random number of length n|

[right ^|a.a|=V|string n|number]

Returns a substring of V| of the n| right hand characters

SQLdate ^|a.a|=a date ~d|days y|years

Tries to create an SQL date from the right hand side. Can deal with 1/2/16 13-05-2016 etc
if ~d| and y| are included then it adds that number of days and years to the result

[string ^|a.a|=V|a string s|search r|replace]

If s| and r| included returns a new string replacing instances of r| with s|
if only s| included returns the start index of the first occasion of s| in V|, -1 for not found

[time ^|a.a|=^|a.time1| + ^|a.time2|]

Adds or subtracts 2 times in the format 12:30:45

[trim ^|a.a|=A bunch of text and hats]

Returns the text with all leading and trailing whitespace characters removed.