Author Topic: Highlight% changes by itself  (Read 10620 times)

0 Members and 1 Guest are viewing this topic.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Highlight% changes by itself
« on: April 11, 2022, 01:34:56 pm »
I often make a DO LOOP with an INKEY$ to access the string values of the arrow keys. Out of probably 25 times writing a loop similar to this one, this is the second time I could not use my HaltAndDisplay% bool to stop the flicker.
On line 56, the Highlight% rapidly changes between positive and negative integers of about 3 to 5 digits. From what I can see in the code I've written, Highlight% shouldn't change until
one of the SHARED ArrowKey$ Values has been detected. I'd be grateful to anyone who can't point out my error
Code: QB64: [Select]
  1.  
  2. _TITLE "Time Calculator"
  3.  
  4. CONST TRUE% = 1
  5. CONST FALSE% = -1
  6. DIM SHARED LeftArrowKey$: LeftArrowKey$ = CHR$(0) + "K"
  7. DIM SHARED RightArroeKey$: rightArrowKey$ = CHR$(0) + "M"
  8. DIM SHARED UpArrowKey$: UpArrowKey$ = CHR$(0) + "H"
  9. DIM SHARED DownArrowKey$: DownArrowKey$ = CHR$(0) + "P"
  10. CONST UpArrowHit% = 18432
  11. CONST LeftArrowHit% = 19200
  12. CONST RightArrowHit% = 19712
  13. CONST DownArrowHit% = 20480
  14. ' for the highlighted option in the GetTimeAmount SUB
  15. CONST YearsHO% = 1
  16. CONST DaysHO% = 2
  17. CONST HoursHO% = 3
  18. CONST MinutesHO% = 4
  19. CONST SecondsHO% = 5
  20.  
  21. WIDTH 80, 50
  22. COLOR 14, 1: CLS
  23.  
  24. CALL Menu
  25.  
  26. SUB FromNowUntil
  27.  
  28. SUB HowLongSince
  29.  
  30. SUB WhatDateAfterElapsedTime
  31.  
  32. SUB AddElapsedTimes
  33.  
  34. SUB SubtractElapsedTimes
  35.  
  36. SUB Multiply
  37.  
  38. SUB Divide
  39.  
  40.  
  41. SUB Menu
  42.   HaltAndDisplay% = 0: Highlight% = 0: yPos% = 0: UserCommand$ = "": A$ = ""
  43.   xPos% = 0: MaxOption% = 0: SelectedAnOption% = 0
  44.  
  45.   HaltAndDisplay% = TRUE%: Highlight% = 1: yPos% = 13: MaxOption% = 8: SelectedAnOption% = FALSE%
  46.   DO
  47.     UserCommand$ = INKEY$
  48.     LOCATE 45, 1: PRINT S$(Highlight%)
  49.     LOCATE 46, 1: PRINT "|" + UserCommand$ + "|"
  50.     IF HaltAndDisplay% = TRUE% THEN
  51.       COLOR 14, 1: CLS
  52.       A$ = "Time Calculator Menu": xPos% = Center(A$)
  53.       LOCATE yPos%, Center(A$): PRINT A$: LOCATE yPos% + 1, Center(A$)
  54.       PRINT "---- ---------- ----"
  55.  
  56.       A$ = "": A$ = "1.) Find How Long From Now"
  57.       LOCATE yPos% + 3, Center(A$): IF Highlight% = 1 THEN
  58.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  59.       A$ = "": A$ = "Until A Selected Time"
  60.       LOCATE yPos% + 4, Center(A$): IF Highlight% = 1 THEN
  61.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  62.  
  63.       A$ = "": A$ = "2.) Find How Long It Has Been Since"
  64.       LOCATE yPos% + 6, Center(A$): IF highlighedoption% = 2 THEN
  65.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  66.       A$ = "": A$ = "A Selected Time Has Passed"
  67.       LOCATE yPos% + 7, Center(A$): IF Highlight% = 2 THEN
  68.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  69.  
  70.       A$ = "": A$ = "3.) Find The Date And Time It Will Be After"
  71.       LOCATE yPos% + 9, Center(A$): IF Highlight% = 3 THEN
  72.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  73.       A$ = "": A$ = "A Selected Amount Of Time Has Passed"
  74.       LOCATE yPos% + 10, Center(A$): IF Highlight% = 3 THEN
  75.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  76.  
  77.       A$ = "": A$ = "4.) Add Two Elapsed Times"
  78.       LOCATE yPos% + 12, Center(A$): IF Highlight% = 4 THEN
  79.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  80.  
  81.       A$ = "": A$ = "5.) Subtract One Elapsed Time From Another One"
  82.       LOCATE yPos% + 14, Center(A$): IF Highlight% = 5 THEN
  83.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  84.  
  85.       A$ = "": A$ = "6.) Multiply An Elapsed Time By A Constant"
  86.       LOCATE yPos% + 16, Center(A$): IF Highlight% = 6 THEN
  87.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  88.  
  89.       A$ = "": A$ = "7.) Divide An Elapsed Time By A Constant"
  90.       LOCATE yPos% + 18, Center(A$): IF Highlight% = 7 THEN
  91.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  92.  
  93.       A$ = "": A$ = "8.) Exit"
  94.       LOCATE 45, Center(A$): IF Highlight% = 8 THEN
  95.       COLOR 10, 0: ELSE COLOR 14, 1: END IF: PRINT A$
  96.  
  97.       HaltAndDisplay% = FALSE%
  98.     END IF
  99.  
  100.     SELECT CASE UserCommand$
  101.       CASE UpArrowKey$, LeftArrowKey$
  102.         Highlight% = highlightedoption - 1
  103.         IF Highlight% = 0 THEN Highlight% = MaxOption%
  104.         HaltAndDisplay% = TRUE%
  105.       CASE DownArrowKey$, rightarrowkey$
  106.         Highlight% = Highlight% + 1
  107.         IF highlightedoption > maxoption THEN Highlight% = 1
  108.         HaltAndDisplay% = TRUE%
  109.       CASE CHR$(13)
  110.         SelectedAnOption% = TRUE%
  111.       CASE "1", "2", "3", "4", "5", "6", "7"
  112.         Highlight% = VAL(UserCommand$)
  113.         SelectedAnOption% = TRUE%
  114.     END SELECT
  115.     IF SelectedAnOption% = TRUE THEN
  116.       SELECT CASE Highlight%
  117.         CASE 1
  118.           CALL FromNowUntil: SelectedAnOption% = FALSE%
  119.         CASE 2
  120.           CALL HowLongSince: SelectedAnOption% = FALSE%
  121.         CASE 3
  122.           CALL WhatDateAfterElapsedTime: SelectedAnOption% = FALSE%
  123.         CASE 4
  124.           CALL AddElapsedTimes: SelectedAnOption% = FALSE%
  125.         CASE 5
  126.           CALL SubtractElapsedTimes: SelectedAnOption% = FALSE%
  127.         CASE 6
  128.           CALL Multiply: SelectedAnOption% = FALSE%
  129.         CASE 7
  130.           CALL Divide: SelectedAnOption% = FALSE%
  131.       END SELECT
  132.     END IF
  133.   LOOP UNTIL UserCommand$ = CHR$(27) OR UserCommand$ = S$(MaxOption%)
  134.  
  135.  
  136.  
  137.  
  138.  
  139. FUNCTION Center% (Text$): Center% = INT((80 - LEN(Text$)) / 2): END FUNCTION
  140. FUNCTION S$ (Number!): S$ = LTRIM$(STR$(Number!)): END FUNCTION
  141. FUNCTION P$: pause$ = INPUT$(1): IF pause$ = CHR$(27) THEN END
  142. P$ = pause$: END FUNCTION
  143.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #1 on: April 11, 2022, 01:50:20 pm »
I added _display and _limit to stop flicker.

Once you use _display, then you must say _display every time you want to show something immediatedly. To disable _display use _autodisplay and get default automatic "display". You could put that at the end of the sub before exiting. _display once in you main drawing loop is best.
Code: QB64: [Select]
  1.  
  2. _Title "Time Calculator"
  3.  
  4. Const TRUE% = 1
  5. Const FALSE% = -1
  6. Dim Shared LeftArrowKey$: LeftArrowKey$ = Chr$(0) + "K"
  7. Dim Shared RightArroeKey$: rightArrowKey$ = Chr$(0) + "M"
  8. Dim Shared UpArrowKey$: UpArrowKey$ = Chr$(0) + "H"
  9. Dim Shared DownArrowKey$: DownArrowKey$ = Chr$(0) + "P"
  10. Const UpArrowHit% = 18432
  11. Const LeftArrowHit% = 19200
  12. Const RightArrowHit% = 19712
  13. Const DownArrowHit% = 20480
  14. ' for the highlighted option in the GetTimeAmount SUB
  15. Const YearsHO% = 1
  16. Const DaysHO% = 2
  17. Const HoursHO% = 3
  18. Const MinutesHO% = 4
  19. Const SecondsHO% = 5
  20.  
  21. Width 80, 50
  22. Color 14, 1: Cls
  23.  
  24. Call Menu
  25.  
  26. Sub FromNowUntil
  27.  
  28. Sub HowLongSince
  29.  
  30. Sub WhatDateAfterElapsedTime
  31.  
  32. Sub AddElapsedTimes
  33.  
  34. Sub SubtractElapsedTimes
  35.  
  36. Sub Multiply
  37.  
  38. Sub Divide
  39.  
  40.  
  41. Sub Menu
  42.     HaltAndDisplay% = 0: Highlight% = 0: yPos% = 0: UserCommand$ = "": A$ = ""
  43.     xPos% = 0: MaxOption% = 0: SelectedAnOption% = 0
  44.  
  45.     HaltAndDisplay% = TRUE%: Highlight% = 1: yPos% = 13: MaxOption% = 8: SelectedAnOption% = FALSE%
  46.     Do
  47.         UserCommand$ = InKey$
  48.         Locate 45, 1: Print S$(Highlight%)
  49.         Locate 46, 1: Print "|" + UserCommand$ + "|"
  50.         If HaltAndDisplay% = TRUE% Then
  51.             Color 14, 1: Cls
  52.             A$ = "Time Calculator Menu": xPos% = Center(A$)
  53.             Locate yPos%, Center(A$): Print A$: Locate yPos% + 1, Center(A$)
  54.             Print "---- ---------- ----"
  55.  
  56.             A$ = "": A$ = "1.) Find How Long From Now"
  57.             Locate yPos% + 3, Center(A$): If Highlight% = 1 Then
  58.             Color 10, 0: Else Color 14, 1: End If: Print A$
  59.             A$ = "": A$ = "Until A Selected Time"
  60.             Locate yPos% + 4, Center(A$): If Highlight% = 1 Then
  61.             Color 10, 0: Else Color 14, 1: End If: Print A$
  62.  
  63.             A$ = "": A$ = "2.) Find How Long It Has Been Since"
  64.             Locate yPos% + 6, Center(A$): If highlighedoption% = 2 Then
  65.             Color 10, 0: Else Color 14, 1: End If: Print A$
  66.             A$ = "": A$ = "A Selected Time Has Passed"
  67.             Locate yPos% + 7, Center(A$): If Highlight% = 2 Then
  68.             Color 10, 0: Else Color 14, 1: End If: Print A$
  69.  
  70.             A$ = "": A$ = "3.) Find The Date And Time It Will Be After"
  71.             Locate yPos% + 9, Center(A$): If Highlight% = 3 Then
  72.             Color 10, 0: Else Color 14, 1: End If: Print A$
  73.             A$ = "": A$ = "A Selected Amount Of Time Has Passed"
  74.             Locate yPos% + 10, Center(A$): If Highlight% = 3 Then
  75.             Color 10, 0: Else Color 14, 1: End If: Print A$
  76.  
  77.             A$ = "": A$ = "4.) Add Two Elapsed Times"
  78.             Locate yPos% + 12, Center(A$): If Highlight% = 4 Then
  79.             Color 10, 0: Else Color 14, 1: End If: Print A$
  80.  
  81.             A$ = "": A$ = "5.) Subtract One Elapsed Time From Another One"
  82.             Locate yPos% + 14, Center(A$): If Highlight% = 5 Then
  83.             Color 10, 0: Else Color 14, 1: End If: Print A$
  84.  
  85.             A$ = "": A$ = "6.) Multiply An Elapsed Time By A Constant"
  86.             Locate yPos% + 16, Center(A$): If Highlight% = 6 Then
  87.             Color 10, 0: Else Color 14, 1: End If: Print A$
  88.  
  89.             A$ = "": A$ = "7.) Divide An Elapsed Time By A Constant"
  90.             Locate yPos% + 18, Center(A$): If Highlight% = 7 Then
  91.             Color 10, 0: Else Color 14, 1: End If: Print A$
  92.  
  93.             A$ = "": A$ = "8.) Exit"
  94.             Locate 45, Center(A$): If Highlight% = 8 Then
  95.             Color 10, 0: Else Color 14, 1: End If: Print A$
  96.  
  97.             HaltAndDisplay% = FALSE%
  98.         End If
  99.  
  100.         Select Case UserCommand$
  101.             Case UpArrowKey$, LeftArrowKey$
  102.                 Highlight% = highlightedoption - 1
  103.                 If Highlight% = 0 Then Highlight% = MaxOption%
  104.                 HaltAndDisplay% = TRUE%
  105.             Case DownArrowKey$, rightarrowkey$
  106.                 Highlight% = Highlight% + 1
  107.                 If highlightedoption > maxoption Then Highlight% = 1
  108.                 HaltAndDisplay% = TRUE%
  109.             Case Chr$(13)
  110.                 SelectedAnOption% = TRUE%
  111.             Case "1", "2", "3", "4", "5", "6", "7"
  112.                 Highlight% = Val(UserCommand$)
  113.                 SelectedAnOption% = TRUE%
  114.         End Select
  115.         If SelectedAnOption% = TRUE Then
  116.             Select Case Highlight%
  117.                 Case 1
  118.                     Call FromNowUntil: SelectedAnOption% = FALSE%
  119.                 Case 2
  120.                     Call HowLongSince: SelectedAnOption% = FALSE%
  121.                 Case 3
  122.                     Call WhatDateAfterElapsedTime: SelectedAnOption% = FALSE%
  123.                 Case 4
  124.                     Call AddElapsedTimes: SelectedAnOption% = FALSE%
  125.                 Case 5
  126.                     Call SubtractElapsedTimes: SelectedAnOption% = FALSE%
  127.                 Case 6
  128.                     Call Multiply: SelectedAnOption% = FALSE%
  129.                 Case 7
  130.                     Call Divide: SelectedAnOption% = FALSE%
  131.             End Select
  132.         End If
  133.         _Display ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< added this and next
  134.         _Limit 30
  135.     Loop Until UserCommand$ = Chr$(27) Or UserCommand$ = S$(MaxOption%)
  136.  
  137.  
  138.  
  139.  
  140.  
  141. Function Center% (Text$): Center% = Int((80 - Len(Text$)) / 2): End Function
  142. Function S$ (Number!): S$ = LTrim$(Str$(Number!)): End Function
  143. Function P$: pause$ = Input$(1): If pause$ = Chr$(27) Then End
  144. P$ = pause$: End Function
  145.  
  146.  
  147.  

Marked as best answer by Jaze on April 11, 2022, 10:08:41 am

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #2 on: April 11, 2022, 01:57:05 pm »
Oh you are trying to highlite something, ehhh

deja vu again today:

Didn't I suggest False% = 0 ???

An If is going to see both -1 and 1 as True and take the THEN path.
« Last Edit: April 11, 2022, 02:05:10 pm by bplus »

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: Highlight% changes by itself
« Reply #3 on: April 11, 2022, 02:10:17 pm »
changing the false constant to zero made no difference. besides I like the -1, 1 so I can flip them by multiplying by -1

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #4 on: April 11, 2022, 02:19:33 pm »
Ah, I use "toggle"
toggle = 1 - toggle  0,1,0,1,....

True, False a little misleading, but everyone has their styles and preferences....

You are attempting to highlight line ready to go on Enter maybe after arrow presses, I assume.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: Highlight% changes by itself
« Reply #5 on: April 11, 2022, 02:20:56 pm »
I added _DISPLAY and _LIMIT as suggest which does fix the flicker but dose not allow an option to be highlighted and selected with the arrow keys

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #6 on: April 11, 2022, 02:27:22 pm »
Yeah working on highlights.. looks like just _limit 30 is enough to stop flicker.

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: Highlight% changes by itself
« Reply #7 on: April 11, 2022, 02:30:36 pm »
This code does what it is supposed to without the flicker and allows the use of the arrow keys. I didn't think the options were clear enough so I rewrote it. I don't see any difference in this style of the Menu compared to the other. Apart from the text their nearly identical but this one works... just a pain in the ass reordering the menu options but I apparently have no choice

Code: QB64: [Select]
  1. SUB Menu
  2.   DIM highlightedOption, haltAndDisplay, xPos, maxOption, yPos AS INTEGER
  3.   DIM userCommand$
  4.  
  5.   highlightedOption = 1
  6.   haltAndDisplay = TRUE
  7.   maxOption = 8
  8.   yPos = 14
  9.   DO
  10.     userCommand$ = INKEY$
  11.     IF haltAndDisplay = TRUE THEN
  12.       COLOR 14, 1: CLS
  13.       a$ = "Time Calculator": xPos = Center(a$): LOCATE yPos, xPos: PRINT a$
  14.       LOCATE yPos + 1, xPos - 1: PRINT "-----------------"
  15.       a$ = "1.) Add 2 Time Amounts": LOCATE yPos + 5, Center(a$)
  16.       IF highlightedOption = 1 THEN
  17.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  18.       PRINT a$
  19.       a$ = "2.) Add 1 Time Amount To A Date and Time": LOCATE yPos + 7, Center(a$)
  20.       IF highlightedOption = 2 THEN
  21.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  22.       PRINT a$
  23.       a$ = "3.) Subtract 1 Time Amount From Another": LOCATE yPos + 9, Center(a$)
  24.       IF highlightedOption = 3 THEN
  25.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  26.       PRINT a$
  27.       a$ = "4.) Find Date And Time Before Another Date And Time": LOCATE yPos + 11, Center(a$)
  28.       IF highlightedOption = 4 THEN
  29.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  30.       PRINT a$
  31.       a$ = "5.) Multiply 1 Time Amount By A Constant": LOCATE yPos + 13, Center(a$)
  32.       IF highlightedOption = 5 THEN
  33.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  34.       PRINT a$
  35.       a$ = "6.) Divide 1 Time Amount By A Constant": LOCATE yPos + 15, Center(a$)
  36.       IF highlightedOption = 6 THEN
  37.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  38.       PRINT a$
  39.       a$ = "7.) Find The Time From Now Until": LOCATE yPos + 17, Center(a$)
  40.       IF highlightedOption = 7 THEN
  41.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  42.       PRINT a$
  43.       a$ = "A Selected Date And Time": LOCATE yPos + 18, Center(a$)
  44.       IF highlightedOption = 7 THEN
  45.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  46.       PRINT a$
  47.       a$ = "8.) End": LOCATE yPos + 25, Center(a$)
  48.       IF highlightedOption = 8 THEN
  49.       COLOR 10, 0: ELSE COLOR 14, 1: END IF
  50.       PRINT a$
  51.       haltAndDisplay = FALSE
  52.     END IF
  53.     SELECT CASE userCommand$
  54.       CASE LeftArrowKey$, UpArrowKey$
  55.         highlightedOption = highlightedOption - 1
  56.         IF highlightedOption = 0 THEN highlightedOption = maxOption
  57.         haltAndDisplay = TRUE
  58.       CASE RightArrowKey$, DownArrowKey$
  59.         highlightedOption = highlightedOption + 1
  60.         IF highlightedOption > maxOption THEN highlightedOption = 1
  61.         haltAndDisplay = TRUE
  62.       CASE CHR$(13), CHR$(32)
  63.         SELECT CASE highlightedOption
  64.           CASE 1
  65.             CALL AddTwoTimeAmounts
  66.           CASE 2
  67.             CALL AddTimeToDate
  68.           CASE 3
  69.             CALL SubtractTimeAmounts
  70.           CASE 4
  71.             CALL FindDateBefore
  72.           CASE 5
  73.             CALL MultiplyTimeByConstant
  74.           CASE 6
  75.             CALL DivideTimeByConstant
  76.           CASE 7
  77.             CALL FindTimeUntil
  78.         END SELECT
  79.         haltAndDisplay = TRUE
  80.       CASE "1", "2", "3", "4", "5", "6", "7"
  81.         highlightedOption = VAL(userCommand$)
  82.         SELECT CASE highlightedOption
  83.           CASE 1
  84.             CALL AddTwoTimeAmounts
  85.           CASE 2
  86.             CALL AddTimeToDate
  87.           CASE 3
  88.             CALL SubtractTimeAmounts
  89.           CASE 4
  90.             CALL FindDateBefore
  91.           CASE 5
  92.             CALL MultiplyTimeByConstant
  93.           CASE 6
  94.             CALL DivideTimeByConstant
  95.           CASE 7
  96.             CALL FindTimeUntil
  97.         END SELECT
  98.         haltAndDisplay = TRUE
  99.     END SELECT
  100.   LOOP UNTIL userCommand$ = CHR$(27) OR userCommand$ = "8"

Offline Jaze

  • Newbie
  • Posts: 86
    • View Profile
Re: Highlight% changes by itself
« Reply #8 on: April 11, 2022, 02:39:45 pm »
I had an earlier version of the Time Calculator in desperate need of an overhaul. Hence I came up with the second menu. I commented out the Menu in the older version, cut and pasted the newer menu (the first one I posted) into the program needing the overhaul and it worked fine. Doing the same in reverse, putting the older menu into the newer version of the program and commented out the newer menu. And it flickered. So I have identical code in two different windows behaving differently

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #9 on: April 11, 2022, 02:49:09 pm »
Type-O!
Code: QB64: [Select]
  1. Dim Shared RightArroeKey$: rightArrowKey$ = Chr$(0) + "M"
  2.  

need w in arrow where e is!

I found it by watching highlight continuously increasing even when keys not pressed.
« Last Edit: April 11, 2022, 02:55:44 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #10 on: April 11, 2022, 03:07:48 pm »
Line 110 should be this:
Code: QB64: [Select]
  1.  Highlight% = Highlight% - 1    
  2.  

because the up arrow was not changing the highlight number.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #11 on: April 11, 2022, 03:10:55 pm »
add this in around line 115:
Code: QB64: [Select]
  1. If Highlight% > 8 Then Highlight% = 1  
  2.  

So highlight won't exceed 8

Now I think it will work as intended.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Highlight% changes by itself
« Reply #12 on: April 11, 2022, 03:27:11 pm »
Added this in to check running the subs for time:
Code: QB64: [Select]
  1.  If SelectedAnOption% = TRUE% Then
  2. ' debug check the selection code section
  3.             Cls
  4.             Print "You selected "; Highlight%
  5.             _Delay 2
  6.             SelectedAnOption% = FALSE%
  7.             HaltAndDisplay% = TRUE%
  8.  
  9. ' commented out next section, as not ready
  10.             'Select Case Highlight%
  11.             '    Case 1
  12.             '        Call FromNowUntil: SelectedAnOption% = FALSE%
  13.             '    Case 2
  14.