(view source code of dec2hex.rex as plain text)
/* Dec2Hex.rex, Version 1.01 */
/* Parse command line parameters */
parse arg number dummy .
/* Check command line parameters */
if number = "" then call Syntax
if dummy <> "" then call Syntax
if Pos( "?", number ) > 0 then call Syntax
if DataType( number, "W" ) = 0 then call Syntax
/* Convert the number and display the result */
say
say number||" = 0x"||Right( D2X( number ), 8, "0" )
Exit 0
Syntax:
say
say "Dec2Hex.rex, Version 1.01"
say "Convert specified decimal number to 8 digit hexadecimal"
say
say "Usage: <REXX> DEC2HEX.REX number"
say
say 'Where: "<REXX>" is your Rexx interpreter:'
say " - Windows: REGINA.EXE or REXX.EXE, whichever you installed"
say " - OS/2: no need to specify, just rename script to *.cmd"
say ' "number" is any decimal number ranging from 0..2147483647 (0x7FFFFFFF)'
say
say "Written by Rob van der Woude"
say "http://www.robvanderwoude.com"
Exit 1
Return
page last modified: 2024-04-16; loaded in 0.0051 seconds