Page 1 of 1
Needing some pointer on primitive data handling.
Posted: Fri Nov 06, 2009 8:33 pm
by sfitzjava
So I'm trying to mask one value with another such as taking two text values and bitwise anding them.
put 1234530530 into val1
put fileCRC.bin(txtfile) into val2 // this function calcs the CRC of a file.
put val1 bitAnd val2 into val3
Something like the above.
Posted: Fri Nov 06, 2009 10:01 pm
by ukimiku
Hi, sfitzjava,
please write also where you perceive a problem with your attempt. So far, the bitAnd should work just fine. Was it pseudo-code that you wrote?
Regards,
Posted: Sun Nov 08, 2009 11:26 pm
by sfitzjava
I get an error: "bitAnd: error in left operand"
however my CRC value is a mashup of characters in the debugger which is the left operand, and my right operand is a nice looking number.
However the same error if I use binaryEncoding("M",bigNum) and the right operand is a mashup of characters. (I'm assuming this is the binary rep of the number)
-sf
UPDATE:
Got it worked out. Like ukimiku said I had the pseudo correct. A lot of differences between Java and RevTalk.

But there may be an issue with the bitAnd and bitXor commands error messages. They say the left operand, and I figured it was the one before the command. Seems the right operand was the issue. I was using an index and was starting it at 0. This is from Java where arrays are zero based, except when dealing with SQL.

Good now I don't have that little conversion to always do.
Any way once I changed it to start at 1 things started to work.