UpperA$ = UCASE$("a")
LowerA$ = LCASE$("A")
char upperA = toupper('a');
char lowerA = tolower('A');
#define toupper(c) islower(c) ? (c) - 'a' + 'A' : (c)
#define tolower(c) isupper(c) ? (c) - 'A' + 'a' : (c)
This only works because the alphanumeric letters are consecutive. This would not work, for instance, with EBCDIC.
Unicode defines case folding through the three case mapping properties of each character: uppercase, lowercase and titlecase. These properties relate all characters in scripts with differring cases to the other case variants of the character.