Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
INKEY$ doesn't work with fixed length strings
#21
I'm all about keeping backward compatibility. So, would something as simple as ending the fixed length strings in CHR$(0) instead of CHR$(32) break many programs? If so, make it optional like metacommand? Default to legacy, add '_FIXEDSTRINGSZERO ON'

I don't mind rolling my on LEN() function, but it is difficult to tell if that space at the end of the string was put there by your code, or was part of the initialization.

Code: (Select All)
DIM a AS STRING * 8
PRINT "t.a = "; t.a
a = "01234 " ' <--- intentional space for whatever reason, but you want it have a trailing space.

As pointed out by Pete, in the case of INKEY$, k is going to get filled with 2 spaces regardless if you hit the space bar.

Code: (Select All)
DIM k AS STRING * 2
k = INKEY$
'How do you detect the space bar?


Regardless, It seems that there is little or no interest in this issue, and that I'm the oddball.  Again, I'm not dying on this hill.
Reply


Messages In This Thread
RE: INKEY$ doesn't work with fixed length strings - by justsomeguy - 07-31-2024, 06:27 PM



Users browsing this thread: 7 Guest(s)