Like this.
[tt]
sub cvt(ninteger,bitstring)
'convert integer to bit string (no padding)
'bitstring is out-param
dim dvd
bitstring=cstr(ninteger mod 2) & bitstring
dvd=n\2
if dvd<>0 then
cvt dvd,bitstring
end if
end sub
dim n,bitstr
n=8
bitstr=""
cvt n,bitstr
response.write n & " : " & bitstr & "<br />"
[/tt]