| Author |
delete method of B&S
|
mohini lalwani
Greenhorn
Joined: Nov 24, 2008
Posts: 25
|
|
Hi All, In my delete method I am doing like this . database.writeBytes("1"); becasue in instruction written 1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record please tell me is it okay ???
|
 |
Jeffry Kristianto Yanuar
Ranch Hand
Joined: Oct 01, 2007
Posts: 759
|
|
I prefer use writeBytes() method that use int as the parameter. Either way, just make sure that it works the way you want. In my assignment, the delete flag is short, so I use writeShort() method to mark the record as deleted. Good Luck !!! Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
|
 |
Alecsandru Cocarla
Ranch Hand
Joined: Feb 29, 2008
Posts: 158
|
|
|
You should not use the writeBytes(String) version, as character '1' is not the same thing as integer 1 (the value of '1' is in fact 49).
|
SCJP 1.4 100%
SCJD 99.5%
|
 |
christian combarel
Ranch Hand
Joined: Aug 04, 2007
Posts: 47
|
|
Hello all, Are you sure that 1 is the right value for a deleted record ? In the spec we can read :
0xFF implies deleted record
, yet 0xFF = -1 ... (I'm currently working on UB-1.3.3) Chris
|
-------------
Chris
|
 |
christian combarel
Ranch Hand
Joined: Aug 04, 2007
Posts: 47
|
|
|
Sorry for my previous post, I've just seen it's about B&S and not URLyBird !
|
 |
Jeffry Kristianto Yanuar
Ranch Hand
Joined: Oct 01, 2007
Posts: 759
|
|
Originally posted by christian combarel: Sorry for my previous post, I've just seen it's about B&S and not URLyBird !
Different version of URLyBird also has different delete flag. That's why I always included my version of URLyBird when I open the thread. Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
|
 |
 |
|
|
subject: delete method of B&S
|
|
|