In my delete method, I need to change the flag from 00 to 0xFF. I do this:
However, when I do tests, I get strange results because of that value I know that when I read 0xFF from my datafile, it comes out as -1. Am I using the correct write method to write 0xFF. Does the negative sign count as a byte? Because that may be why my program is getting thrown off? I ran a simple
test where I updated the flag in my first record by executing the code above. When I then ran my class to read all my records, I get weird results. However, when I went back and executed the line above, but instead wrote dbReader.writeByte(00), and ran my class again, it worked perfectly. So something is getting messed up when I write 0xFF. Any ideas on why it is doing this?
Here's a snippet of my code just so you can understand what's going on:
I just wanted to read 2 records and see what the results were. My first record's flag is -1 (0xFF) and the 2nd record's flag is 0. Here is what I get when I do my output:
-1
66
CRAP!
[ November 21, 2004: Message edited by: Daniel Simpson ]