Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

delete method of B&S

 
mohini lalwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
christian combarel
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
christian combarel
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for my previous post, I've just seen it's about B&S and not URLyBird !
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic