home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
OL.LZH
/
PROCS.LZH
/
INSTRING.ICN
< prev
next >
Wrap
Text File
|
1991-07-13
|
949b
|
34 lines
############################################################################
#
# Name: intstring (intstr.icn)
#
# Title: Creates a string consisting of the raw bits of an integer.
#
# Author: Robert J. Alexander
#
# Date: April 2, 1990
#
############################################################################
#
# intstring() -- Creates a string consisting of the raw bits in the low
# order "size" bytes of integer i.
#
# This procedure is normally used for processing of binary data
# to be written to a file.
#
# Note that if large integers are supported, this procedure still
# will not work for integers larger than the implementation defined
# word size due to the shifting in of zero-bits from the left in the
# right shift operation.
#
procedure intstring(i,size)
local s
s := ""
every 1 to size do {
s := char(iand(i,16rFF)) || s
i := ishift(i,-8)
}
return s
end