#B .J NEW 1 REM This a very short and simple, but general, number base converter, 2 REM taken from Ray Yeargin's BASECV.RY for the Tandy Model 100. 3 REM It is very short on error correction; so it will happily 4 REM convert the Hex value G (an unallowable) to 16 dec (a very 5 REM rationale conclusion). 6 REM >>>Code adapted to the Z88 and enhanced for repetitive cases 7 REM by Phil Wheeler -- 12/23/88 8 REM 9 *NAME BASES 10 CLS:PRINT:PRINT:INPUT"Base in";I:INPUT"Base out";O:A$="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 20 U=0:Q=0:V=0:O$="":B$="":INPUT"# to convert ";B$:IF B$="" THEN END ELSE:Y=LEN(B$):FOR X=1 TO Y:D=INSTR(A$,MID$(B$,X,1))-1:U=U+I^(Y-X)*D:NEXT 40 IF O^(1+Q)<=U THEN Q=Q+1:GOTO 40 60 IF O^Q*(V+1)<=U THEN V=V+1:GOTO 60 80 O$=O$+MID$(A$,V+1,1):U=U-O^Q*V:Q=Q-1:V=0:IF Q<0 THEN PRINT " ";O$:GOTO 20:ELSE60