1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-25 21:33:44 +00:00
C02/test/ctypetst.c02

57 lines
1.3 KiB
Plaintext
Raw Normal View History

/*************************************
* CTYPETST - Test Library ctype.h02 *
*************************************/
//Specify System Header using -H option
#include <ctype.h02>
char c, i;
main:
i = 0;
head:
putstr(" ");
putchr('C'); //Control
putchr('S'); //White Space
putchr('P'); //Punctuation
putchr('D'); //Digit
putchr('H'); //Hex Digit
putchr('U'); //Upper Case
putchr('L'); //Lower Case
putchr('A'); //Alphabetic
putchr('N'); //Alphanumeric
putchr('G'); //Graphic
putchr('R'); //Printable
putchr('B'); //Binary
newlin();
loop:
prbyte(i);
putchr(' ');
c = i;
if (c < $20) c = $20;
if (c >= $7F) c = $20;
putchr(c);
putchr(' ');
c = isctrl(i) & $0A | $20; putchr(c);
c = isspce(i) & $0A | $20; putchr(c);
c = ispnct(i) & $0A | $20; putchr(c);
c = isdigt(i) & $0A | $20; putchr(c);
c = ishdgt(i) & $0A | $20; putchr(c);
c = isuppr(i) & $0A | $20; putchr(c);
c = islowr(i) & $0A | $20; putchr(c);
c = isalph(i) & $0A | $20; putchr(c);
c = isalnm(i) & $0A | $20; putchr(c);
c = isgrph(i) & $0A | $20; putchr(c);
c = isprnt(i) & $0A | $20; putchr(c);
c = isbdgt(i) & $0A | $20; putchr(c);
newlin();
i++;
if (i == 0) goto exit;
if (i & $0F <> 0) goto loop;
newlin();
c = getkey();
if (c == $1B) goto exit;
goto head;