home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_BAS / DNALIB59.ZIP / PICKBOX.BAS < prev    next >
BASIC Source File  |  1994-02-23  |  19KB  |  545 lines

  1. DECLARE SUB Popwind(Title$,Toprow%,Leftcolumn%,Bottomrow%,Rightcolumn%,Attr%,Shadow%,Border%)
  2. DECLARE SUB RestoreScreen(ScreenID$,TopRow%,LeftColumn%)
  3. DECLARE SUB SaveScreen(ScreenID$,TopRow%,LeftColumn%,BottomRow%,RightColumn%,Shadow%)
  4. DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
  5. DECLARE SUB Clicked(Rgt%,Lft%,Row%,Col%)
  6. DECLARE SUB HideCursor()
  7. DECLARE SUB ShowCursor()
  8. DECLARE SUB LocateCursor(Row%,Col%)
  9. DECLARE FUNCTION LeftButtonReleased%()
  10. DECLARE FUNCTION AltKey%()
  11.  
  12. SUB PickBox(StringArray$(),ReturnedArray$,Title$,TopRow%,Tag%,Mouse%,Attr%,BarAttr%,ButtonAttr%,Shadow%,Border%)PUBLIC
  13.  
  14. CalcByte Attr%,FGround%,BGround%
  15. CalcByte BarAttr%,BarFG%,BarBG%
  16. CalcByte ButtonAttr%,BtFG%,BtBG%
  17. PickStart% = 1: PickFinish% = 60: PickPointer% = 1
  18.  
  19. DO
  20.  
  21. INCR i%
  22. INCR j%
  23.                                                                                                                                                                                 'strings there are and the
  24. IF LEN (StringArray$(i%)) = 0 THEN
  25.   DECR i%
  26. ELSE
  27.   StringArray$(i%) = " " + StringArray$(i%)
  28. END IF
  29.  
  30. LOOP WHILE i% = j%
  31.  
  32. PickCount% = i%
  33.  
  34.  
  35. IF Mouse% THEN HideCursor
  36.  
  37. SaveScreen PickScreen$,TopRow%,3 - Shadow%,20,78 - Shadow%,Shadow%
  38. Popwind Title$,TopRow%,3 - Shadow%,TopRow% + 18,78 - Shadow%,Attr%,Shadow%,Border%
  39. Popwind "",TopRow% + 1,5 - Shadow%,TopRow% + 14,76 - Shadow%,Attr%,0,1
  40.  
  41. IF Tag% AND ISFALSE Mouse% THEN
  42.   COLOR FGround%,BGround%
  43.   LOCATE TopRow% + 18,27 - Shadow%,0: PRINT "[ Space Bar to Tag - UnTag ]";
  44. END IF
  45.  
  46. IF Mouse% THEN
  47.   COLOR FGround%,BGround%
  48.   LOCATE TopRow%,5 - Shadow%,0
  49.   PRINT CHR$(91,254,93);
  50.   IF Tag% THEN
  51.     COLOR FGround%,BGround%
  52.     LOCATE TopRow% + 18,17 - Shadow%,0: PRINT "[ Space Bar or Left Mouse button to Tag - UnTag ]";
  53.   END IF
  54. END IF
  55.  
  56. COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,7 - Shadow%,0: PRINT " Enter ";
  57. COLOR 0,BGround%: LOCATE TopRow% + 16,14 - Shadow%,0: PRINT "▄";
  58. COLOR 0,BGround%: LOCATE TopRow% + 17,8 - Shadow%,0: PRINT "▀▀▀▀▀▀▀";
  59. COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,18 - Shadow%,0: PRINT " Esc ";
  60. COLOR 0,BGround%: LOCATE TopRow% + 16,23 - Shadow%,0: PRINT "▄";
  61. COLOR 0,BGround%: LOCATE TopRow% + 17,19 - Shadow%,0: PRINT "▀▀▀▀▀"
  62.  
  63. DO
  64.  
  65. MouseJump:
  66.  
  67. IF Tag% THEN
  68.   COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,27 - Shadow%,0: PRINT " Tag All ";
  69.   COLOR 0,BGround%: LOCATE TopRow% + 16,36 - Shadow%,0: PRINT "▄";
  70.   COLOR 0,BGround%: LOCATE TopRow% + 17,28 - Shadow%,0: PRINT "▀▀▀▀▀▀▀▀▀";
  71.   COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,40 - Shadow%,0: PRINT " UnTag All ";
  72.   COLOR 0,BGround%: LOCATE TopRow% + 16,51 - Shadow%,0: PRINT "▄";
  73.   COLOR 0,BGround%: LOCATE TopRow% + 17,41 - Shadow%,0: PRINT "▀▀▀▀▀▀▀▀▀▀▀";
  74.   COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,55 - Shadow%,0: PRINT " Reverse Tags ";
  75.   COLOR 0,BGround%: LOCATE TopRow% + 16,69 - Shadow%,0: PRINT "▄";
  76.   COLOR 0,BGround%: LOCATE TopRow% + 17,56 - Shadow%,0: PRINT "▀▀▀▀▀▀▀▀▀▀▀▀▀▀";
  77. END IF
  78.  
  79. GOSUB PrintRoutine
  80.  
  81. WHILE NOT INSTAT
  82.   IF Mouse% THEN
  83.     IF SaveMouse% THEN LocateCursor MouseRow%,MouseCol%
  84.     ShowCursor
  85.     Rgt% = 0:Lft% = 0:MRow% = 0:MCol% = 0:SaveMouse% = 0
  86.     Clicked Rgt%,Lft%,MRow%,MCol%
  87.     IF MRow% >= TopRow% AND MRow% <= TopRow% + 18 AND MCol% >= 3 - Shadow% AND MCol% <= 78 - Shadow% THEN
  88.       IF MRow% > TopRow% + 1 AND MRow% < TopRow% + 14 AND MCol% > 5 - Shadow% AND MCol% < 76 - Shadow% THEN
  89.         SELECT CASE MCol%
  90.           CASE 6 - Shadow% TO 19 - Shadow%
  91.             IF PickPointer% = PickStart%  + (MRow% - (TopRow% + 2)) THEN
  92.               IF LeftButtonReleased% THEN
  93.                 Chose% = 32: GOTO KeyBoardRoutine
  94.               END IF
  95.             ELSE
  96.               IF PickStart% + (MRow% - (TopRow% + 2)) <= PickCount% THEN
  97.                 PickPointer% = PickStart% + (MRow% - (TopRow% + 2))
  98.                 GOTO MouseJump
  99.               END IF
  100.             END IF
  101.           CASE 20 - Shadow% TO 33 - Shadow%
  102.             IF PickPointer% = PickStart% + 12 + (MRow% - (TopRow% + 2)) THEN
  103.               IF LeftButtonReleased% THEN
  104.                 Chose% = 32: GOTO KeyBoardRoutine
  105.               END IF
  106.             ELSE
  107.               IF PickStart% + 12 + (MRow% - (TopRow% + 2)) <= PickCount% THEN
  108.                 PickPointer% = PickStart% + 12 + (MRow% - (TopRow% + 2))
  109.                 GOTO MouseJump
  110.               END IF
  111.             END IF
  112.           CASE 34 - Shadow% TO 47 - Shadow%
  113.             IF PickPointer% = PickStart% + 24 + (MRow% - (TopRow% + 2)) THEN
  114.               IF LeftButtonReleased% THEN
  115.                 Chose% = 32: GOTO KeyBoardRoutine
  116.               END IF
  117.             ELSE
  118.               IF PickStart% + 24 + (MRow% - (TopRow% + 2)) <= PickCount% THEN
  119.                 PickPointer% = PickStart% + 24 + (MRow% - (TopRow% + 2))
  120.                 GOTO MouseJump
  121.               END IF
  122.             END IF
  123.           CASE 48 - Shadow% TO 61 - Shadow%
  124.             IF PickPointer% = PickStart% + 36 + (MRow% - (TopRow% + 2)) THEN
  125.               IF LeftButtonReleased% THEN
  126.                 Chose% = 32: GOTO KeyBoardRoutine
  127.               END IF
  128.             ELSE
  129.               IF PickStart% + 36 + (MRow% - (TopRow% + 2)) <= PickCount% THEN
  130.                 PickPointer% = PickStart% + 36 + (MRow% - (TopRow% + 2))
  131.                 GOTO MouseJump
  132.               END IF
  133.             END IF
  134.           CASE 62 - Shadow% TO 75 - Shadow%
  135.             IF PickPointer% = PickStart% + 48 + (MRow% - (TopRow% + 2)) THEN
  136.               IF LeftButtonReleased% THEN
  137.                 Chose% = 32: GOTO KeyBoardRoutine
  138.               END IF
  139.             ELSE
  140.               IF PickStart% + 48 + (MRow% - (TopRow% + 2)) <= PickCount% THEN
  141.                 PickPointer% = PickStart% + 48 + (MRow% - (TopRow% + 2))
  142.                 GOTO MouseJump
  143.               END IF
  144.             END IF
  145.         END SELECT
  146.       ELSE
  147.         SELECT CASE MRow%
  148.           CASE TopRow%
  149.             IF MCol% = 6 - Shadow% THEN
  150.               IF LeftButtonReleased% THEN Chose% = 27: GOTO KeyBoardRoutine
  151.             END IF
  152.           CASE TopRow% + 14
  153.             SELECT CASE MCol%
  154.               CASE 11 - Shadow% TO 12 - Shadow%
  155.                 IF Lft% THEN Chose% = -72: GOTO KeyBoardRoutine
  156.               CASE 69 - Shadow% TO 70 - Shadow%
  157.                 IF Lft% THEN Chose% = -80: GOTO KeyBoardRoutine
  158.             END SELECT
  159.           CASE TopRow% + 16
  160.             SELECT CASE MCol%
  161.               CASE 7 - Shadow% TO 13 - Shadow%   'Enter
  162.                 IF LeftButtonReleased% THEN Chose% = 13: GOTO KeyBoardRoutine
  163.               CASE 18 - Shadow% TO 22 - Shadow%  'Esc
  164.                 IF LeftButtonReleased% THEN Chose% = 27: GOTO KeyBoardRoutine
  165.               CASE 27 - Shadow% TO 35 - Shadow%  'Tag All
  166.                 IF LeftButtonReleased% THEN Chose% = -20: GOTO KeyBoardRoutine
  167.               CASE 40 - Shadow% TO 50 - Shadow%  'UnTag All
  168.                 IF LeftButtonReleased% THEN Chose% = -22: GOTO KeyBoardRoutine
  169.               CASE 55 - Shadow% TO 68 - Shadow%  'Reverse Tags
  170.                 IF LeftButtonReleased% THEN Chose% = -19: GOTO KeyBoardRoutine
  171.             END SELECT
  172.         END SELECT
  173.       END IF
  174.     ELSE
  175.       IF LeftButtonReleased% THEN Chose% = 27: GOTO KeyBoardRoutine
  176.     END IF
  177.   END IF
  178.     IF AltKey% THEN
  179.       IF Tag% THEN
  180.         COLOR BarFG%,BtBG%: LOCATE TopRow% + 16,28 - Shadow%,0: PRINT "T";
  181.         COLOR BarFG%,BtBG%: LOCATE TopRow% + 16,41 - Shadow%,0: PRINT "U";
  182.         COLOR BarFG%,BtBG%: LOCATE TopRow% + 16,56 - Shadow%,0: PRINT "R";
  183.       END IF
  184.     END IF
  185. WEND
  186.  
  187. Ky$ = INKEY$
  188.  
  189. IF LEN(Ky$) = 1 THEN
  190.   Chose% = ASC(Ky$)
  191. ELSE
  192.   Chose% = -ASC(RIGHT$(Ky$,1))
  193. END IF
  194.  
  195. KeyBoardRoutine:
  196.  
  197. IF Mouse% THEN
  198.   IF MRow% > TopRow% + 1 AND MRow% < TopRow% + 14 AND_
  199.     MCol% > 5 - Shadow% AND MCol% < 76 - Shadow% THEN
  200.     SaveMouse% = 1
  201.     LocateCursor 1,1
  202.   END IF
  203. END IF
  204.  
  205.   SELECT CASE Chose%
  206.        CASE -19 'Alt R
  207.          IF Tag% THEN
  208.            IF Mouse% THEN HideCursor
  209.            COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,56 - Shadow%,0: PRINT " Reverse Tags ";
  210.            COLOR 0,BGround%: LOCATE TopRow% + 16,55 - Shadow%,0: PRINT " ";
  211.            COLOR 0,BGround%: LOCATE TopRow% + 17,56 - Shadow%,0: PRINT "              ";
  212.            DELAY .2
  213.            FOR i% = 1 TO PickCount%
  214.              IF INSTR(StringArray$(i%),CHR$(Tag%)) THEN
  215.                ReturnedArray$ = REMOVE$(ReturnedArray$,StringArray$(i%))
  216.                StringArray$(i%) = " " + LTRIM$(StringArray$(i%),CHR$(Tag%))
  217.              ELSE
  218.                StringArray$(i%) = CHR$(Tag%) + LTRIM$(StringArray$(i%))
  219.                ReturnedArray$ = ReturnedArray$ + StringArray$(i%)
  220.              END IF
  221.            NEXT i%
  222.          END IF
  223.        CASE -22 'Alt U
  224.          IF Tag% THEN
  225.            IF Mouse% THEN HideCursor
  226.            COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,41 - Shadow%,0: PRINT " UnTag All ";
  227.            COLOR 0,BGround%: LOCATE TopRow% + 16,40 - Shadow%,0: PRINT " ";
  228.            COLOR 0,BGround%: LOCATE TopRow% + 17,41 - Shadow%,0: PRINT "           ";
  229.            DELAY .2
  230.            FOR i% = 1 TO PickCount%
  231.              IF INSTR(StringArray$(i%),CHR$(Tag%)) THEN
  232.                ReturnedArray$ = REMOVE$(ReturnedArray$,StringArray$(i%))
  233.                StringArray$(i%) = " " + LTRIM$(StringArray$(i%),CHR$(Tag%))
  234.              END IF
  235.            NEXT i%
  236.          END IF
  237.        CASE -20 'Alt T
  238.          IF Tag% THEN
  239.            IF Mouse% THEN HideCursor
  240.            COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,28 - Shadow%,0: PRINT " Tag All ";
  241.            COLOR 0,BGround%: LOCATE TopRow% + 16,27 - Shadow%,0: PRINT " ";
  242.            COLOR 0,BGround%: LOCATE TopRow% + 17,28 - Shadow%,0: PRINT "         ";
  243.            DELAY .2
  244.            FOR i% = 1 TO PickCount%
  245.              IF INSTR(StringArray$(i%),CHR$(32)) THEN
  246.                StringArray$(i%) = CHR$(Tag%) + LTRIM$(StringArray$(i%))
  247.                ReturnedArray$ = ReturnedArray$ + StringArray$(i%)
  248.              END IF
  249.            NEXT i%
  250.          END IF
  251.        CASE -71 ' home
  252.          IF PickCount% < 60 THEN
  253.            PickPointer% = 1
  254.          ELSE
  255.            PickPointer% = 1
  256.            PickStart% = 1
  257.            PickFinish% = 60
  258.          END IF
  259.        CASE -72 ' up arrow
  260.          IF PickPointer% > 1 THEN
  261.            DECR PickPointer%
  262.            IF PickPointer% < PickStart% THEN
  263.              DECR PickStart%:DECR PickFinish%
  264.            END IF
  265.          END IF
  266.        CASE -73 ' page up
  267.          IF PickPointer% - 60 > 0 THEN
  268.            IF PickStart% - 60 > 0 THEN
  269.              DECR PickPointer%,60
  270.              DECR PickStart%,60
  271.              DECR PickFinish%,60
  272.            ELSE
  273.              DECR PickPointer%,60
  274.              PickStart% = 1
  275.              PickFinish% = 60
  276.            END IF
  277.          ELSE
  278.            PickStart% = 1
  279.            PickFinish% = 60
  280.          END IF
  281.        CASE -75 ' left arrow
  282.          IF PickPointer% - 12 > 0 THEN
  283.            DECR PickPointer%,12
  284.            IF PickPointer% < PickStart% THEN
  285.              IF PickStart% - 12 > 0 THEN
  286.                DECR PickStart%,12:DECR PickFinish%,12
  287.              ELSE
  288.                PickStart% = 1
  289.                PickFinish% = 60
  290.              END IF
  291.            END IF
  292.          ELSE
  293.            IF PickCount% > 60 THEN
  294.              PickStart% = 1
  295.              PickFinish% = 60
  296.            END IF
  297.          END IF
  298.        CASE -77 ' right arrow
  299.          IF PickPointer% + 12 <= PickCount% THEN
  300.            INCR PickPointer%,12
  301.            IF PickPointer% > PickFinish% THEN
  302.              IF PickFinish% + 12 < PickCount% THEN
  303.                INCR PickStart%,12:INCR PickFinish%,12
  304.              ELSE
  305.                PickFinish% = PickCount%
  306.                PickStart% = PickFinish% - 59
  307.              END IF
  308.            END IF
  309.          ELSE
  310.            IF PickCount% > 60 THEN
  311.              PickFinish% = PickCount%
  312.              PickStart% = PickFinish% - 59
  313.            END IF
  314.          END IF
  315.        CASE -79 ' end key
  316.          IF PickCount% < 60 THEN
  317.            PickPointer% = PickCount%
  318.          ELSE
  319.            PickPointer% = PickCount%
  320.            PickStart% = PickCount% - 59
  321.            PickFinish% = PickCount%
  322.          END IF
  323.        CASE -80 ' down arrow
  324.          IF PickPointer% < PickCount% THEN
  325.            INCR PickPointer%
  326.            IF PickPointer% > PickFinish% THEN
  327.              INCR PickStart%:INCR PickFinish%
  328.            END IF
  329.          END IF
  330.        CASE -81 ' page down
  331.          IF PickCount% > 60 THEN
  332.            IF PickPointer% + 60 <= PickCount% THEN
  333.              IF PickFinish% + 60 <= PickCount% THEN
  334.                INCR PickPointer%,60
  335.                INCR PickStart%,60
  336.                INCR PickFinish%,60
  337.              ELSE
  338.                INCR PickPointer%,60
  339.                PickFinish% = PickCount%
  340.                PickStart% = PickFinish% - 59
  341.              END IF
  342.            ELSE
  343.              PickFinish% = PickCount%
  344.              PickStart% = PickFinish% - 59
  345.            END IF
  346.          END IF
  347.        CASE 13  ' enter
  348.          IF Tag% > 0 THEN
  349.            IF LEN(ReturnedArray$) THEN
  350.              ReturnedArray$ = ReturnedArray$
  351.            ELSE
  352.              ReturnedArray$ = ""
  353.            END IF
  354.          ELSE
  355.            ReturnedArray$ = LTRIM$(StringArray$(PickPointer%))
  356.          END IF
  357.          EXIT LOOP
  358.        CASE 27  ' Esc
  359.          ReturnedArray$ = ""
  360.          EXIT LOOP
  361.        CASE 32  'Space Bar
  362.           IF Tag% THEN
  363.             IF INSTR(StringArray$(PickPointer%),CHR$(Tag%)) THEN
  364.               ReturnedArray$ = REMOVE$(ReturnedArray$,StringArray$(PickPointer%))
  365.               StringArray$(PickPointer%) = " " + LTRIM$(StringArray$(PickPointer%),CHR$(Tag%))
  366.             ELSE
  367.               StringArray$(PickPointer%) = CHR$(Tag%) + LTRIM$(StringArray$(PickPointer%))
  368.               ReturnedArray$ = ReturnedArray$ + StringArray$(PickPointer%)
  369.             END IF
  370.             IF PickPointer% < PickFinish% AND PickPointer% < PickCount% THEN
  371.               INCR PickPointer%
  372.             ELSEIF PickFinish% < PickCount% THEN    'check to see if we have
  373.               INCR PickPointer%                     'any more choices waiting
  374.               INCR PickStart%
  375.               INCR PickFinish%
  376.             END IF
  377.           END IF
  378.         CASE 65 TO 90,97 TO 122
  379.             Found% = 0
  380.             Marker% = PickPointer%
  381.             IF PickPointer% + 1 <= PickCount% THEN  'search forward from pointer
  382.               FOR i% = PickPointer% + 1 TO PickCount%
  383.                 Temp$ = LEFT$(StringArray$(i%),2)       'get two characters
  384.                 TestKey$ = UCASE$(RIGHT$(Temp$,1))  'char after the space or tag
  385.                   IF TestKey$ = UCASE$(CHR$(Chose%)) THEN 'compare first char to key
  386.                     Found% = 1
  387.                     PickPointer% = i%
  388.                     IF PickPointer% + 60 <= PickCount% THEN
  389.                       PickFinish% = PickPointer% + 59
  390.                       PickStart% = PickFinish% - 59
  391.                     ELSE
  392.                       IF PickCount% > 60 THEN
  393.                         PickFinish% = PickCount%
  394.                         PickStart% = PickFinish% - 59
  395.                       END IF
  396.                     END IF
  397.                     EXIT FOR
  398.                   END IF
  399.               NEXT i%
  400.             END IF
  401.             IF Found% = 0 THEN
  402.               FOR j% = 1 TO PickPointer%
  403.                 Temp$ = LEFT$(StringArray$(j%),2)
  404.                 TestKey$ = UCASE$(RIGHT$(Temp$,1))
  405.                   IF TestKey$ = UCASE$(CHR$(Chose%)) THEN
  406.                     Found% = 1
  407.                     PickPointer% = j%
  408.                     IF PickPointer% = Marker% THEN
  409.                       BEEP:EXIT FOR
  410.                     ELSE
  411.                       IF PickPointer% + 60 <= PickCount% THEN
  412.                         PickFinish% = PickPointer% + 59
  413.                         PickStart% = PickFinish% - 59
  414.                       ELSE
  415.                         IF PickCount% > 60 THEN
  416.                           PickFinish% = PickCount%
  417.                           PickStart% = PickFinish% - 59
  418.                         END IF
  419.                       END IF
  420.                     END IF
  421.                     EXIT FOR
  422.                   END IF
  423.               NEXT j%
  424.             END IF
  425.             IF Found% = 0 THEN
  426.               BEEP
  427.             END IF
  428.        CASE ELSE
  429.          BEEP
  430.  
  431.   END SELECT
  432.  
  433. LOOP
  434.  
  435. SELECT CASE Chose%
  436.   CASE 13
  437.     IF Mouse% THEN HideCursor
  438.     COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,8 - Shadow%,0: PRINT " Enter ";
  439.     COLOR 0,BGround%: LOCATE TopRow% + 16,7 - Shadow%,0: PRINT " ";
  440.     COLOR 0,BGround%: LOCATE TopRow% + 17,8 - Shadow%,0: PRINT "       ";
  441.   CASE 27
  442.     IF Mouse% THEN HideCursor
  443.     COLOR BtFG%,BtBG%: LOCATE TopRow% + 16,19 - Shadow%,0: PRINT " Esc ";
  444.     COLOR 0,BGround%: LOCATE TopRow% + 16,18 - Shadow%,0: PRINT " ";
  445.     COLOR 0,BGround%: LOCATE TopRow% + 17,19 - Shadow%,0: PRINT "     "
  446. END SELECT
  447.  
  448. FOR i% = 1 TO PickCount%
  449.   IF INSTR(StringArray$(i%),CHR$(Tag%)) THEN
  450.     StringArray$(i%) = LTRIM$(StringArray$(i%),CHR$(Tag%)) 'remove tag char
  451.   ELSE
  452.     StringArray$(i%) = LTRIM$(StringArray$(i%))            'remove the space
  453.   END IF
  454. NEXT i%
  455.  
  456. IF Mouse% THEN HideCursor
  457. IF SaveMouse% THEN LocateCursor MouseRow%,MouseCol%
  458.  
  459. DELAY .5
  460.  
  461. RestoreScreen PickScreen$,TopRow%,3 - Shadow%
  462.  
  463. EXIT SUB
  464. '----------------------------------------------------------------------------
  465. PrintRoutine:
  466.  
  467. Row% = TopRow% + 2
  468. Col% = 6 - Shadow%
  469.  
  470. IF Mouse% THEN HideCursor
  471.  
  472. FOR a% = PickStart% TO PickFinish%
  473.   IF a% = PickStart% + 12 OR a% = PickStart% + 24 _
  474.   OR a% = PickStart% + 36 OR a% = PickStart% + 48 _
  475.   THEN Row% = TopRow% + 2:INCR Col%,14
  476.   IF a% = PickPointer% THEN
  477.     COLOR BarFG%,BarBG%
  478.     LOCATE Row%,Col%,0
  479.     IF SaveMouse% THEN MouseRow% = Row%: MouseCol% = Col% + 6
  480.     PRINT  StringArray$(a%) + SPACE$(14 - LEN(StringArray$(a%)));
  481.   ELSE
  482.     COLOR FGround%,BGround%
  483.     LOCATE Row%,Col%,0
  484.     PRINT StringArray$(a%) + SPACE$(14 - LEN(StringArray$(a%)));
  485.   END IF
  486.   INCR Row%
  487. NEXT a%
  488.  
  489. PickScrollBar% = PickCount% \ 58
  490. IF PickScrollBar% < 1 THEN PickScrollBar% = 1
  491. Bar% = 0
  492. Col% = 11 - Shadow%
  493.  
  494. IF PickPointer% THEN
  495.   ScrollPickPointer% = PickPointer%
  496. ELSE
  497.   ScrollPickPointer% = 1
  498. END IF
  499.  
  500. COLOR FGround%,BGround%
  501. LOCATE TopRow% + 1,61 - Shadow%,0
  502. PRINT "┤            ├";
  503. COLOR BarFG%,BGround%
  504. LOCATE TopRow% + 1,62 - Shadow%,0
  505. PRINT ScrollPickPointer%; "of"; PickCount%;
  506.  
  507. FOR a% = PickStart% TO PickFinish%
  508.   COLOR FGround%,BGround%
  509.   LOCATE TopRow% + 14,Col%,0
  510.   IF a% = PickStart% THEN
  511.     PRINT CHR$(27);
  512.   ELSEIF a% = PickFinish% THEN
  513.     PRINT CHR$(26);
  514.   ELSE
  515.     IF Bar% =  0 THEN
  516.       c% = ScrollPickPointer%
  517.       FOR i% = 1 TO PickScrollBar%
  518.         b% = c% \ PickScrollBar%
  519.         IF a% = b% + PickStart% THEN
  520.           Bar% = 1
  521.           EXIT FOR
  522.         ELSE
  523.           INCR c%
  524.         END IF
  525.       NEXT i%
  526.       IF Bar%  THEN
  527.         PRINT CHR$(219);
  528.       ELSE
  529.         IF Bar% = 0 AND a% = PickFinish% - 1 THEN
  530.           PRINT CHR$(219);
  531.         ELSE
  532.           PRINT CHR$(176);
  533.         END IF
  534.       END IF
  535.     ELSE
  536.       PRINT CHR$(176);
  537.     END IF
  538.   END IF
  539.   INCR Col%
  540. NEXT a%
  541.  
  542. RETURN
  543. '----------------------------------------------------------------------------
  544. END SUB
  545.