DAY 014: ASC
#7
Oh, another interesting observation is ASC() should not be used as a true/false indicator.

Code: (Select All)
$CONSOLE:ONLY
_CONTROLCHR OFF
FOR i = 0 TO 255
    PRINT i; CHR$(i);
    IF ASC(CHR$(i)) THEN PRINT "I'm a character!" ELSE PRINT "I'm not a character" ' Note, it misses CHR$(0), which is a blank character.
NEXT

Pete
If eggs are brain food, Biden takes his scrambled.
Reply


Messages In This Thread
DAY 014: ASC - by SMcNeill - 11-18-2022, 04:31 PM
RE: DAY 014: ASC - by Pete - 11-18-2022, 06:49 PM
RE: DAY 014: ASC - by james2464 - 11-18-2022, 07:19 PM
RE: DAY 014: ASC - by Pete - 11-18-2022, 07:30 PM
RE: DAY 014: ASC - by mnrvovrfc - 11-18-2022, 11:30 PM
RE: DAY 014: ASC - by Pete - 11-19-2022, 12:09 AM
RE: DAY 014: ASC - by Pete - 11-19-2022, 12:14 AM
RE: DAY 014: ASC - by PhilOfPerth - 11-19-2022, 01:09 AM
RE: DAY 014: ASC - by SMcNeill - 11-19-2022, 06:27 AM



Users browsing this thread: 5 Guest(s)