Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lock CAPS poking memory
#4
oblo Wrote:How can value 0 be L and C at the same time? Is not any other value/variable in the ZX Spectrum to check that CAPS is ON? And thanks again, 2018 and still learning things about this computer Big Grin
If what you need is to get always the Uppercase value of the key pressed, you can use the Upper() function.
Code:
#include <ucase.bas>

POKE 23611, PEEK 23611 bOR 8: REM <== VERY Recommended initialization, to make it work an all Spectrum modes / clones

10 PRINT "Please, press a letter key"
20 LET k$ = UCase(CHR$(PEEK 23560)): PRINT AT 0, 0; k$; " ";
30 IF k$ < "A" OR k$ > "Z" THEN GOTO 20
40 PRINT "You pressed "; k$
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)