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

(B&S)I think I corrupted my Datafile

 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I think i have just corrupted my datafile, i did an update(a booking) and i realised when i re-read the entire datafile i could see nothing returned. I believe it is in the way i coded my update(), i didnt cater for the part of the instructions that says:

All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field. The character encoding is 8 bit US ASCII.



How do i cater for this part of the instructions?
My code for my update() is thus:


P.S If any code of conduct is violated due to the posting of this source code, pls feel free to edit,change or remove it. Thanks
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should have checked the actual content of the file against the description of the content of the file.
The actual content (which you have to code against) is different from the stated content.
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Could you give me an insight into how to tackle the part of the instructions that says:

All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field. The character encoding is 8 bit US ASCII.



Could you explain what is meant by this statement.(Honestly i ignored it while coding(i did it on purpose actually since most people here say the statment is wrong)). So an insight will be appreciated.
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it means that according to the specs each string is ended with a \0 (ascii value 0).
In reality they aren't but are padded with spaces to the maximum length of the field (at least in my version).

Prime example of a conflict between the file description received from the customer and the actual data itself.
How to work with that is part of the things you have to figure out for yourself as the assignment tests you on real world problem solving abilities and this certainly is a real world problem (I've encountered it several times in my 10 years in the industry).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic