• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

question about the delete()

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,everyone:
in my Introduction,explain follow:
2 byte flag. 00 implies valid record, 0x8000 implies deleted record
in the Data,the delete() to write 2 byte flag for delete a record ,
but 0x8000 is int,is 5 byte,can't to write the db file,
how to implement the delete function?
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you convert the hex number 0x8000 to integer, you will discover that it is in fact the upper bound of short integer value: 32768.
Thus, it is a 2-byte flag (16 bit), and you can regard it as 2 single bytes:
one is 0x80 and the other is 0x00.
Hope this help.
Nick
[ December 10, 2003: Message edited by: Nicholas Cheung ]
 
Jofer Chan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Nicholas:
thank you,
it's great!
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic