Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there an IsAlpha function in QB64PE?
#8
The ctype.h header is allready included in QB64pe and its functions can easily accessed via a declare library block.
Code: (Select All)
DECLARE LIBRARY
    'ctype.h
    FUNCTION isalnum% (BYVAL c AS INTEGER) 'is an alphabet letter(isalpha(c) or isdigit(c))
    FUNCTION isalpha% (BYVAL c AS INTEGER) 'is letter (isupper(c) or islower(c))
    FUNCTION isdigit% (BYVAL c AS INTEGER) 'is a decimal digit
    FUNCTION isgraph% (BYVAL c AS INTEGER) 'is a printing character other than space
    FUNCTION islower% (BYVAL c AS INTEGER) 'is a lower-case letter
    FUNCTION isprint% (BYVAL c AS INTEGER) 'is printing character. ASCII: &H20 (" ") to &H7E (~)
    FUNCTION ispunct% (BYVAL c AS INTEGER) 'is printing character other than space, letter, digit
    FUNCTION isspace% (BYVAL c AS INTEGER) 'is space, formfeed, newline, return, tab, vertical tab
    FUNCTION isupper% (BYVAL c AS INTEGER) 'is upper-case letter
    FUNCTION isxdigit% (BYVAL c AS INTEGER) 'is a hexdecimal digit character(0 thru 9 or A thru F)
END DECLARE

LINE INPUT "Gimme a char: "; c$

IF isalpha%(ASC(c$)) THEN
    PRINT "Is alpha."
ELSE
    PRINT "Is NOT alpha."
END IF

END
For more informations/other functions see https://qb64phoenix.com/qb64wiki/index.php/C_Libraries
Reply


Messages In This Thread
RE: Is there an IsAlpha function in QB64PE? - by RhoSigma - 04-01-2023, 07:54 AM



Users browsing this thread: 1 Guest(s)