copies thereof & !may be provided or otherwise made available to any other & !person. No title to and ownership of the software is hereby & !transferred. & ! & !The information in this software is subject to change without & !notice and should not be construed as a commitment by Whittier & !College or the author. & ! & !Whittier College assumes no responsibility for the use or & !reliability of its software on equipment that is not supplied & !by Whittier College. Whittier College supplies no equipment. & ! & !***************************************************************& ! 12 ! & ! This program was written for internal use and has not & !been significantly modified for export. You may need to make & !changes to fit your system or needs. If you have any problems & !please contact: & ! & ! David Garland & ! Whittier College & ! Whittier CA 90601 & ! (213) 693-0771 ext 289 & ! 20 ! & ! RAD50 & ! & !A program to demonstrate a function to convert a string to & !RAD50. The built-in function RAD$ will convert from RAD50. & !The file name string scan function can be used to convert to & !RAD50, but can't convert strings which have periods in them. & ! 21 ! & ! Pedantic lecture: & ! & ! "Radix" is a mathematic term for "base", as in "base 2" & !( = binary) or "base 8" ( = octal). There are 40(decimal) & !characters in RAD50. Each one is considered as a "digit" in & !base 40(decimal). A group of three characters is regarded as & !a three digit number in base 40 and converted to decimal. The & !decimal valuee is the RAD50 value of the string. Note that the& !largest possible number which need be stored is 40 ^ 3 - 1 = & !63999. 41 characters would require numbers as large as 68920, & !too big for 16 bits. Numbers larger than 63999 do not & !correspond to any string. & ! The point of this discussion is that the correct & !pronunciation of RAD50 is "radix fourty" or "radix five zero", & !not "radix fifty". Note that 50(octal) = 40(decimal) & ! 100 ! & !Get a string & ! 110 PRINT "String to convert (<= 3 characters)"; \ & INPUTLINE S$ \ & S$ = CVT$$(S$,4%) 120 IF S$ = "" THEN GOTO 900 130 S$ = LEFT(S$+" ",3%) 200 ! & !Print converted form and convert back & ! 210 PRINT FNRAD50%(S$), RAD$(FNRAD50%(S$)) 300 ! & !go back & ! 310 GOTO 100 900 ! & !done & ! 990 GOTO 32767 8000 ! & ! & ! FUNCTIONS & ! & ! 8100 ! & !convert three character string to RAD50 & !illegal characters are changed to blanks and a flag is set & ! 8110 DEF FNRAD50%(S$) 8115 T% = 0% 8120 FOR I% = 1% TO 3% 8125 S% = ASCII(LEFT(S$,1%)) \ & S$ = RIGHT(S$,2%) 8130 IF 65% <= S% AND S% <= 90% & THEN S% = S% - 64% \ & GOTO 8175 8135 IF 48% <= S% AND S% <= 57% & THEN S% = S% - 18% \ & GOTO 8175 8140 IF S% = 32% & THEN S% = 0% \ & GOTO 8175 8145 IF S% = 36% & THEN S% = 27% \ & GOTO 8175 8150 IF S% = 46% & THEN S% = 28% \ & GOTO 8175 8155 IF S% = 63% & THEN S% = 29% \ & GOTO 8175 8170 ILLEGALCHARACTER% = -1% \ & FNRAD50% = 0% \ & GOTO 8190 8175 T% = T% * 40% + S% 8180 NEXT I% 8185 FNRAD50% = T% 8190 FNEND 32767 END RAD50 BAS[.050021]RAD50 .BAS[.050021]   X1혀4¿