Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Convert Integer to BitArray

$
0
0
Hi, I'm not able to figure out how I can convert an integer to an BitArray

Example:
8 (0,0,0,1,0,0,0,0)
3 (1,1,0,0.0.0.0.0)

I tried to Convert the Integer to a Byte[] in dotnet. This Byte[] I want to convert into an BitArray.

This Code is wrong and I can't even compile it.

Int := 8;
str := FORMAT(Int);
SystemArray := SystemConvert.FromBase64String(str);
BitArray := BitArray.BitArray(SystemArray);

FOR i := 0 TO BitArray.Length - 1  DO BEGIN
  MESSAGE(FORMAT(BitArray.Get(i)));
END;

I also tried ...
SystemArray := SystemArray.CreateInstance(GETDOTNETTYPE(SystemByte),4);

Help would be great :)

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>