the status quo:
===============
notations:
UPPERCASE letters are verbatim
a,b,x string literals
c,d,e single characters
f,g,h formats producing a single string value
i,j,k,l,m,n,o numbers (formats processed in integer context)
ll list of numbers (pushed by an expression)
* mode
Mcd c = P, H or D, d = U or L
P proof mode: no changes applied
H heading mode:
^x is replaced as ';' for x=a, ',' for x=b..i, '.' for others
angle brackets are removed (>< replaced by '; '):
gives b in index, a else
gives nothing in index, a else
D data mode: like heading mode plus '. ' after each field not followed
by a suffix. no '.', if field ends in "punctuation" character.
L lower case: no changes applied
U upper case: characters are converted to "uppercase" as listed
in the file ISISUC.TAB
* field selector s
Vn^c[i..j]
Vn[i..j]^c select field n (0 = all), optional subfield c (* = first),
optional range of occ i to j (j may be ommited or LAST),
Dn^c select presence (optionally of subfield c)
Nn^c select absence (optionally of subfield c)
NOCC(s) total number of occurences of field s (NUMERIC)
P(s) true, if s is present (BOOLEAN, see IF)
A(s) true, if s is absent (BOOLEAN, see IF)
["x" a ["x" a ...]][|x|[+]]s[*o][.l][(k[,m])][[+]|x|]["x"]
here [] are not literal, but indicate optional parts.
x are strings not containing their respective delimiter
a arbitrary formatting or mode commands conditionally executed
repeated prefix or suffix in || output for any repetition,
with + first prefix / last suffix is ommited,
optional string offset o (0=start) and length l,
optional indentation k,m (see formatting)
* structural elements
they do not themselves generate output,
but rather control execution of formats u,v,w
, separator (end some construct)
/*...*/ comment
'a' unconditional literal
@a, include format file a
&a(f) call external function a
(u) repeat group (over IOCC, only in record or string mode)
BREAK break a repeat group or REF
CONTINUE continue a repeat group
SELECT f CASE g: u CASE h: v ... ENDSEL
SELECT f CASE g: u CASE h: v ... ELSECASE w ENDSEL
REF(m,u) apply format to row number m
REF->a(ll,u)
REF([f]ll,u) apply format to row number m in db
En:=m assignment to numerical variable
Sn:=(f) assignment to string variable
IF t THEN u FI
IF t THEN u ELSE v FI
WHILE t (u)
t a boolean expression using:
fxg comparision, where x is one of = <> < <= > >=
AND NOT OR () logical combination
f:g true iff f contains g case insensitiv
P(s) A(s) (see field selector)
f format not empty
* calculation (NUMERIC)
calculation is performed on longs until a decimal point is seen
or RAVR is used.
statistical functions run over format giving a list of numbers,
separated by ; or blank or any other non-numerical characters
+-*/() arithmetic
123 integer literal
123.45 float literal
VAL(f) numeric value of string
RMAX(ll) maximum
RMIN(ll) minimum
RSUM(ll) sum
RAVR(ll) average (always float)
En numerical variable n
* database functions
OCC
IOCC current occurence (1..) in repeat
MFN current mfn (with 6 digits) (NUMERIC)
MFN(n) current mfn (with n digits)
DB
MSTNAME current masterfile (possibly changed by REF)
L(f) mfn of 1st posting for key f (NUMERIC)
L->a(f)
L([g]f) mfn of 1st posting for key f in db (NUMERIC)
LR((f))
LR((f),m,n) list of mfns (postings m through n)
NPOST(f)
NPST(f)
NPOST([g]f) number of postings for f (in db) (NUMERIC)
* system functions
CAT(f) contents of file f
DATE date as yyyymmdd hhmmss w nnn (w day of week, nnn julian)
DATE(DATETIME) dd/mm/yy hh:mm:ss
DATE(DATEONLY) dd/mm/yy
DATE(n) mm-dd-yy (n=2), hh:mm:ss (n=3) or both (n=1)
GETENV(f) value of env variable f
PUTENV(f) read f as x=y, set env var x to y
SYSTEM(f) execute system command
* string functions
LEFT(f,n) substring (first n chars of f)
RIGHT(f,n) substring (last n chars of f)
SS(n,m,f)
MID(f,n,m) substring (m chars starting at n)
REPLACE(f,g,h) replace g in f with h
F(f)
F(f,n)
F(f,n,m) number to string
S(f)*n.m stringify format f, apply optional offset n, length m
INSTR(f,g) pos of g in f (0 = none) (NUMERIC)
SIZE(f) length of string f (NUMERIC)
TYPE(f) A (if alphabetic), N (if numeric) or X (else)
TYPE(?a?,f) 0 or 1, if f matches pattern .... ????
TYPE(n,f) 0 or 1, if f is alphanumeric (n=1), alpha(n=2), digits(n=3),
integer, incl. sign(n=4), number, incl. E-notation(n=5)
Sn string variable n
* changing records
PROC(f) apply changes resulting from f:
D* delete all fields
Dn delete all fields n
Dn/m delete occ m of field n
Ancac add string a (delim by any c) as new field n
Hn m a add string a of length m as new field n
* formatting
# newline unconditional
/ newline if not on line start
% reset blank lines
{
} open/close formatting scope
Vn..(m) or Vn..(m,o) indentation in columns for one field selector
NEWLINE(f) change newline to emit f (\r,\n are recognized in f)
Cm mv to column m
Xm m blanks
M(n)
M(n,m) indentation in twips (twentieth point = 1/1440 inch)
TAB mv to some (?) position
TAB(m) mv to position in twips
LW(n) linewidth
QC center
QJ justify
BOX
BOX(n) box (with color n)
NP
NP(n) newpage (if less than n lines left)
NC
NC(n) new column (if less than n lines left)
FONTS((a,b),...) setup fonts table, each font with family a and name b
COLS((i,j,k),...) setup color table, each color with RGB-values i,j,k
Fn select font n
FSn select fontsize n
B bold
I italic
UL underline
CLn select color n
!cac print ESC a
PICT(f) picture
BPICT(f) background picture
BPICT((f),m) background picture in mode m
LINK((f),g,...) link text f to command g, where g is:
* link commands
TEXTBOX f open box with text f
TEXTBOXCHILD f same, as child of DB window
TEXTBOXRCHILD f same, as child of record window
TEXTBOX[[R]CHILD]LOAD f[,a,b] display format f, optionally changing a to b
TEXTBOX[[R]CHILD]IMG f display img file f
TEXTBOX[i]... with literal [] identify window number i
OPENFILE f open according to filetype
CMD f run external prog f
GOTO m display record with mfn m
LGOTO f display record with key f
GOBACK ... :)
FORMAT f[,a,b] switch format to f, optionally changing a to b
BROWSE a[,m[,f]] browse DB a, mfn m, format f
\,{ and } "must be escaped with a \" (???)