Thursday, December 30, 2021

Cardread.exe successfully recompiled, now introducing my modifications

 RESOLVING THE STRCMPI AND STRNICMP USES TO MAKE THIS COMPILE

I wrote my own version of the case insensitive functions strcmpi and strnicmp, inserting them in the code, which made the Pelles C compiler happy. I built the executable and it executes fine as far as tell without connecting it to a working card reader. 

ADDING IN MY MODIFICATION TO TRUNCATE A FILE UP TO THE POINT IT VERIFIED

This enhancement was inspired by the high frequency of verification failures as I read decks with the M600 card reader. I realized that I was often reading 100 cards, verifying to a point through most of the cards and failing on a verification error. I may have to verify again a few times, or re-read and then verify but the process required me to pass the entire 100 card deck multiple times. 

If I could tell the program to just trim the file I had read to the last successfully verified card, I could put those away and resume with only the remaining cards to be re-read and verified. For example, if the bad card was number 76 then I only had to read and test 25 cards as the first 75 are known to be good. 

To achieve this, I add a "Truncate" button on the GUI which is active only when we are in verify mode, reading cards in binary format, and have just encountered a miscompare on some card. The button will cause the file I had been reading for the comparison to be opened in output mode and truncated to the point of the last good card. 

The M1000 reader was reading much more reliably, thus this enhancement is less necessary than with the troublesome M600. Still, I did the design work and have invested time thus I will complete this project and make use of the button for the infrequent cases where I get a verify error going forward. 

No comments:

Post a Comment