ChoiceBox
From Pickwiki
When using HELP at TCL with a telnet client more than 80 columns wide you will need to fix the CHOICE.BOX.B program.
The program uses a fixed value of 39 as the mid point of the screen and when this is not the case causes all sorts of screen strife.
The following changes (in bold) work for vt220 emulation.
- 0030 SUBROUTINE CHOICE.BOX.B(start.line, max.lines, width, textstr.orig,
- 0031 Button.Array, selvalue,helpstring)
- 0032
- 0033 $INCLUDE UNIVERSE.INCLUDE MTF.INCL.H
- 0034 EQU KEYNUM TO 7
- 0035 DIM string.array(KEYNUM)
- 0036 DIM string.codes(KEYNUM)
- 0037 Default.list=0
- 0038
- 0039 textstr=textstr.orig
- 0040
- 0041 Help.number=0
- 0042 midPoint = int(system(2)/2) - 1 ;* find mid point
- 0043 IF width < 25 THEN width = 25
- 0044 start.col = midPoint - int(width/2) ;* use mid point instead of "39"
- 0045 text.start = start.col
- 0046 IF LENDP(textstr) < width THEN text.start = (midPoint-int(LENDP(textstr)/2)) -1 ;* use mid point instead of "39"
- 0047
- 0048 IF Button.Array="" THEN
- etc ...
Re-compile APP.PROGS CHOICE.BOX.B
CATALOG APP.PROGS *CHOICE.BOX.B FORCE