A&B Computing ‘Jukebox’ program – correction

Allan Gardner
For more details see Hints and Tips section in AMPLINEX 012, published July 1989.
"fkey4"[]  "select"[]
"prog"[]   "run"[]
"fkey4" [
IF("KEY4|""jukebox""LOAD run|M"OSCLI
)ELSE("KEY4 CLEAR|M"OSCLI)IF
]
"select" [
% select file for running or storing
0 oldx #! 6 oldy #! 0 ord #!
0 newx #! 6 newy #! pick
REP( #IN #11 13 #= )UNTIL(
#11 138 #= IF(newy #? 16#< IF(no-y
IF(update   1 newy #+! pick)IF)IF)IF
#11 139 #= IF(newy #?  6#>
IF(update  -1 newy #+! pick)IF)IF
#11 137 #= IF(newx #? 21#< IF(no-x
IF(update  13 newx #+! pick)IF)IF)IF
#11 136 #= IF(newx #?  0#>
IF(update -13 newx #+! pick)IF)IF
#11 135 #= IF( ON fkey4 prog )IF
114 #= IF(refresh)IF
)REP #2  prog
]
"prog" [
% program file sequence buffer
names ptr-a #! 1 ord #+! ord #?
#11 64 #<  IF(
newx #? 3 #+ newy #? tab NOUT
42 ptr-b #? #B!
newy #? 5 #- newx #?
13 #/ #2 11 #* #+ 1#-
FOR(ptr-a #? #B? 1 #+ ptr-a #+!)FOR
7 FOR(1 ptr-a #+! 1 ptr-b #+!
ptr-a #? #B? ptr-b #? #B!
)FOR
1 ptr-a #+! 1 ptr-b #+!
0 ptr-b #? #B!
)ELSE(#2)IF
]
"run" [
% runs Jukebox after clearing any
% currently programmed sequence
% Also resets f4 to normal definition
OFF fkey4
"FX4,1"OSCLI
screen
select
fndnxt
]

Published in AMPLINEX 012, July 1989