05-02-2025, 03:54 PM
@bplus I dunno about the "no gems" statement. A lot of this is ancient code, averaging about 30 years old or whatnot, and yet it's the same type of stuff that we see folks posting and asking about or showing on the forums even today.
A lot of this, I think needs to be looked at and appreciated with a critical eye, and taken with the knowledge that none of our modern underscore commands were used to make things work. And some of the LOGIC in here is rather impressive and worth considering and thinking about.
Take the above little snippet into consideration. It used INKEY$ to read user input, but ingeniously sorts out how to pass the result as a single byte of info, rather than having to parse it twice depending on length! That's a trick I don't remember seeing elsewhere before. I think Pete might love to make use of it sometime as INKEY$ is definitely his coding tool for input usually.
A lot of this, I think needs to be looked at and appreciated with a critical eye, and taken with the knowledge that none of our modern underscore commands were used to make things work. And some of the LOGIC in here is rather impressive and worth considering and thinking about.
Code: (Select All)
Do: k$ = UCase$(InKey$): Loop While k$ = ""
k% = Asc(k$): If k% = 0 Then k% = -Asc(Mid$(k$, 2))
Select Case k%
Case 13: ChooseProgram$ = BF(choice%).F: Exit Do
Case 27: ChooseProgram$ = "": Exit Do
Case -71: choice% = 1: index% = 1
Case -72: choice% = choice% + (choice% > 1)
If choice% < index% Then index% = choice%
Case -73: choice% = choice% - 10: index% = index% - 10
If choice% < 1 Then choice% = 1
If index% < 1 Then index% = 1
Case -79: choice% = hi%: index% = hi% - 9
If index% < 1 Then index% = 1
Case -80: choice% = choice% - (choice% < hi%)
If index% < (choice% - 9) Then index% = choice% - 9
Case -81: choice% = choice% + 10: index% = index% + 10
If choice% > hi% Then choice% = hi%
If index% < (choice% - 9) Then index% = choice% - 9
End Select
Take the above little snippet into consideration. It used INKEY$ to read user input, but ingeniously sorts out how to pass the result as a single byte of info, rather than having to parse it twice depending on length! That's a trick I don't remember seeing elsewhere before. I think Pete might love to make use of it sometime as INKEY$ is definitely his coding tool for input usually.
