Blame | Last modification | View Log | Download | RSS feed
ifndef radix50incradix50inc equ 1save ; no listing over this filelisting off; this translates the ASCII characters 0...127 to their RADIX50; (PDP-11/VAX) representation, as far as possible:; NOTE: The save/restore mechanism will assure that after inclusion; of this file, you still use the same character mapping as you; did before. To activate this mapping, place a 'codepage radix50'; in your code!codepage radix50charsetcharset 0, 31,charset ' ', 0charset '!', '#',charset '$', 27charset '%', 29charset '&', '-',charset '.', 28charset '/',charset '0', '9', 30charset ':', '@',charset 'A', 'Z', 1charset '[', '`',charset 'a', 'z',charset '{', '~',charset 127,255,; This macro stores the given string in (packed) RADIX 50; encoding. The 'radix50' code page does not need to be; selected before usage.radix50 macro arg__rad50_acc set 0__rad50_pos set 0rept strlen(arg)__rad50_ch set CODEPAGE_VAL(CHARFROMSTR(arg, __rad50_pos), "radix50")if __rad50_ch == -1error "string contains characters not representable in RADIX 50"__rad50_acc set __rad50_acc * 40elseif__rad50_acc set __rad50_acc * 40 + __rad50_chendif__rad50_pos set __rad50_pos + 1if (__rad50_pos # 3) == 0word __rad50_acc__rad50_acc set 0endifendmswitch strlen(arg) # 3case 1word __rad50_acc * 40 * 40case 2word __rad50_acc * 40elsecaseendcaseendmrestore ; restore previous listing state and code pageendif ; radix50inc