<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hey Maverick - <br>
<br>
<br>
Perhaps what you are looking for is this?<br>
<br>
fill(Len) -> <<(bnot 0):Len>>.<br>
<br>
<br>
Cheers,<br>
<br>
<p>Robert Carbone</p>
<p>scriptculture.com<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 2/26/19 5:09 PM, maverik a wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CACHcsJa8Kaus3pSD=hMHS=doFw3WgYxaC5TMMkfxEYT_hdC7LA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Hi All,</div>
<div><br>
</div>
<div>I'm trying to create a bit array in Erlang with simple
new() , set() and get() operations. </div>
<div><br>
</div>
<div>My new() looks like: <br>
</div>
<div>
<div style="color:rgb(187,187,187);background-color:rgb(0,43,54);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(38,139,210)">new</span><span style="color:rgb(187,187,187)">(</span><span style="color:rgb(38,139,210)">Max</span><span style="color:rgb(187,187,187)">) </span><span style="color:rgb(133,153,0)">-></span><span style="color:rgb(187,187,187)"> </span></div><div><span style="color:rgb(187,187,187)"> </span><span style="color:rgb(38,139,210)">N</span><span style="color:rgb(187,187,187)"> </span><span style="color:rgb(133,153,0)">=</span><span style="color:rgb(187,187,187)"> </span><span style="color:rgb(211,54,130)">1</span><span style="color:rgb(187,187,187)"> </span><span style="color:rgb(133,153,0)">bsl</span><span style="color:rgb(187,187,187)"> </span><span style="color:rgb(38,139,210)">Max</span><span style="color:rgb(133,153,0)">-</span><span style="color:rgb(211,54,130)">1</span><span style="color:rgb(187,187,187)">,</span></div><div><span style="color:rgb(187,187,187)"> <<</span><span style="color:rgb(38,139,210)">N</span><span style="color:rgb(187,187,187)">>>.</span></div></div>
</div>
<div><br>
</div>
<div>but problem I'm stuck with is, my max can be at most 8 .<br>
<br>
</div>
<div>How can I create a <b>bitstring </b>of Max length ? <br>
</div>
<div><br>
</div>
<div>Regards</div>
<div>Maverick</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
</body>
</html>