ERA based correction work - question

Hi to all of you!
I have a question how you handle to correct code in a view.mc file, based on ERA message:

Reason: when I start to work and add some code lines to eliminate an error - of course all line numbers behind are not the same as before. So, I cannot locate other errors mentioned in ERA anymore.

Work around: make a copy of the view.mc file as template? 

How do you handle this problem when correcting a mc file?

  • I use git to track changes to my code. It's a command-line tool, but you can also use a GUI client such as Github Desktop (Windows/Mac) or TortoiseGit (Windows). The advantage of learning git is that you'll be able to work with github, arguably the world's largest repository of shared code, which would especially serve you well if you ever want to play with anything other than Monkey C. (There's even Garmin-related stuff in other languages, like tools to convert FIT files to JSON.)

    My typical workflow is every time I make a distinct change to my code (e.g. fix bug, implement feature), I commit the changes with git. Every time I release an app, I commit the changes and I tag the project with the version number.

    That way, when I get an ERA report, I simply roll my code back to the state it was when that version was released, so I can pinpoint the error.

    Besides handing crash reports, version control is useful because if something breaks, you can use the source code history to try to determine exactly what change caused the problem. Or if you want to remove some feature you added weeks or months ago, you can use the history to remove only the code which was relevant to that feature.

    Note that you don't have to host your project on github to use git. You can run your own git server, even on Windows: https://bonobogitserver.com/

  • Thank you very much for your explanation. I will dig into it…

  • Work around: make a copy of the view.mc file as template? 

    There's nothing wrong with doing that.

    It might make sense to have a backup anyway.

    Another thing to do is make the changes to later line numbers first.

    (Nothing wrong with using GIT.)