!**************************** AMUS Program Label ******************************
!* Filename: CVT.BAS Date: 10/29/90
!* Category: UTIL Hash Code: Version: 2.0(0)
!* Initials: HIS/LTD Name: John Paiement
!* Company: Holidair Insurance Services, Ltd. Telephone #: 6044124047
!* Related Files: CVT.PNT, CVT.HLP
!* Min. Op. Sys.: Expertise Level: BEG
!* Special: d/BASIC 1.1 required to compile and run this utility
!* Description: This revision of CVT.BAS is a full function calculator, with
!* memory functions. Also, it now supports values entered as a PPN for
!* conversion.
!***************************************************************************
!* NOTE: d/BASIC 1.1 required to compile & run this utility. CVT.HLP file
!* must go in the HLP: account
!*
!* Usage: The numeric base to be input is selected from a bar.input
!* so to enter a Hex number you would press 'H' then input the
!* numeric value. If the value of any input is greater than
!* FFFFh, the RAD50 and BINARY values are not displayed.
!*
!* The function keys around the keypad are how you select the
!* Mathematical/logical operations for the calculator. Logical
!* NOT will display the NOT(val entered) with no accumulation.
!*
!******************************************************************************
program CVT,2.0(0)
map1 G1$, S,30
map1 G2$, S,30
map1 G1, F
map1 G2, F
map1 X, F
function inkey$()
return ucs(chr(getkey(not(.keypress))))
endfunc
case FINI
FLT = ACCUM
OPT = D'SPLAY
OPER = PLUS
again
endcase
case XIT
print tab(24,1);tab(-1,28);
break
endcase
case D'SPLAY
display.field #DECIMAL of "CVT" from FLT
display.field #HEXADEC of "CVT" from hex$(FLT)
display.field #OCTAL of "CVT" from oct$(FLT)
display.field #(DECIMAL+NUM) of "CVT" from M'VAL
display.field #(HEXADEC+NUM) of "CVT" from hex$(M'VAL)
display.field #(OCTAL+NUM) of "CVT" from oct$(M'VAL)
when FLT < 65536 and FLT >= 0
display.field #R'D50 of "CVT" from rad50$(FLT)
display.field #B1NARY of "CVT" from rjust$(bin$(FLT),16)
display.field #P'PN of "CVT" from "[" + oct$(int(FLT/256)) + "," + oct$(FLT - int(int(FLT/256) * 256)) + "]"
else
display.field #R'D50 of "CVT" from "---"
display.field #B1NARY of "CVT" from ""
wend
when M'VAL < 65536 and M'VAL >= 0
display.field #(R'D50+NUM) of "CVT" from rad50$(M'VAL)
display.field #(B1NARY+NUM) of "CVT" from rjust$(bin$(M'VAL),16)
else
display.field #(R'D50+NUM) of "CVT" from "---"
display.field #(B1NARY+NUM) of "CVT" from ""
wend
OPT = 0
again
endcase
case CLR'DSPLAY
ACCUM = 0
FLT = 0
OPER = PLUS
OPT = D'SPLAY
again
endcase
case CLR'MEM
M'VAL = 0
OPT = D'SPLAY
again
endcase