• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trimming values?

 
Alan Mc Kernan
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
URLyBIRD - In the Data class I am trimming all the values that I read in from the data file. Is this a bad idea?

It just makes life easier for me when testing etc.. should i not trim at this level, and maybe trim in my GUI instead?.. you obviously have to trim at some point otherwise the GUI would be very ugly.

Thoughts?

Alan
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alan,

I think it is a good idea to trim within the Data class.

Your instructions tell you that the data is null terminated, but the data file itself seems to contain space-padded data - so you need to handle this discrepancy. An easy way of handling this on reading the data is to trim the data - otherwise, if at a later date you get null terminated data and dont trim it, you will get horrible looking data being displayed in your GUI.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic