HP3000-L Archives

November 2000, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stigers, Greg [And]" <[log in to unmask]>
Reply To:
Stigers, Greg [And]
Date:
Fri, 17 Nov 2000 14:51:34 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (19 lines)
X-no-Archive:yes
Try this. I'm sure there's room for improvement. It does not clean up after
itself, and it does not correctly handle numbers greater than 255, if that
is needed.

:PRINT DECTOBIN.XEQ
PARM PARM=" "
SETVAR NUMBER !PARM
SETVAR STRING ""
WHILE NUMBER <> 0
   SETVAR STRING "![!NUMBER MOD 2]"+"!STRING"
   SETVAR NUMBER NUMBER/2
ENDWHILE
SETVAR STRING RHT("00000000"+"!STRING",8)
ECHO !STRING

Greg Stigers
http://www.cgiusa.com

ATOM RSS1 RSS2