home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
HEX.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-12-12
|
657b
|
33 lines
/* Converts between Hex and Decimal */
cls
say " "
say "Enter an 'h' to convert to HEX, 'd' to convert to DECIMAL."
say " "
parse pull decision
x=TRANSLATE(decision)
if x="H" then do
say " "
say "Enter a decimal number to convert to hex."
say "Type '0' (zero) to terminate the program."
say " "
do until entry=0
parse pull entry
a=d2x(entry)
say " "
say entry "is" a "in hexadecimal."
say " "
end
end
else do
say " "
say "Enter a hex number to convert to decimal."
say "Type '0' (zero) to terminate the program."
say " "
do until entry=0
parse pull entry
a=x2d(entry)
say " "
say entry "is" a "in decimal."
say " "
end
end