; Script to expand a pattern
; written by James Johnston

UPDATEPATTERN
setstring nor ROWS
MULTIPLY 2 nor
KEY ^{BS}{TAB}
KEY nor
KEY {ENTER}

SUBTRACT 2 nor

KEY {HOME}{HOME}{HOME}{HOME}

setstring not TRACKS
COMPARE GLOBALEXISTS YES
ISNOTEQUAL skipmd

KEY {TAB}
SUBTRACT 1 not

;track loop
LABEL skipmd

;row loop

setstring 0 count
setstring typeme {PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}{PGDN}
LABEL loop
ADD 1 count

COMBINE typeme {UP}{INSERT}
COMPARE nor count
ISGREATER loop

SETSTRING 0 TRACKCOUNT

LABEL again
KEY typeme
KEY {TAB}
ADD 1 TRACKCOUNT

COMPARE TRACKCOUNT not
ISLESS again
INFO Done!
ENDSCRIPT


