05-15-2017 12:49 PM - edited 05-15-2017 12:51 PM
I'd like to know if there is a way to automatically remove all "free floating" comments in a LabVIEW project and all it's SubVis, ignoring of course the VI lib. I would like it to include comments inside of structures like Case diagrams, Sequence structures etc. By "free floating" I am referring to comments where you just click on a block diagram and just start typing. Thanks!
Solved! Go to Solution.
05-15-2017 02:04 PM - edited 05-15-2017 02:05 PM
@EduNI wrote:
I'd like to know if there is a way to automatically remove all "free floating" comments in a LabVIEW project and all it's SubVis, ignoring of course the VI lib. I would like it to include comments inside of structures like Case diagrams, Sequence structures etc. By "free floating" I am referring to comments where you just click on a block diagram and just start typing. Thanks!
I don't think that's a very good idea at all. The labels weren't put in there because the developer had a lot of free time to waste. They are there to describe something! What I would do is handle each free label as you come upon them while you are updating something else. Don't automatically delete them, but read them and then decide where the label should go. I can guarantee that you won't want to delete 99.9% of the free labels.
05-15-2017 03:11 PM
Thanks for weighing in. I am the developer in this case. I am well aware of the merits of comments in code. However, it doesn't change my task at hand. 🙂
05-15-2017 03:52 PM
In anticipation of wanting to delete my personal notes to myself I usually preface them with some searchable string, i.e. *** pwm (my initials). Then you can use the "Find and Replace". Not sure with other free floating strings.
05-15-2017 03:56 PM - edited 05-15-2017 03:59 PM
@EduNI wrote:
Thanks for weighing in. I am the developer in this case. I am well aware of the merits of comments in code. However, it doesn't change my task at hand. :-).
Comments will not effect the execution. So,. Unless they are known to be in error, modify but don't delete. Heck, a good percentage of my bds have a "``" comment
I don't auto tool. Tab tab sometimes comes out as an unexpected comment
Shift 3 works neetly for Putnams notes to self.
05-15-2017 04:22 PM - edited 05-15-2017 04:39 PM
While I agree with everyone saying that doing this isn't exactly a good idea... you didn't come here asking for my opinion.
I believe "Traverse for GObjects" is what you are looking for. If I recall, the class name for comments is just "Text" - though I also believe this won't catch structure comments.
Unrelated, I've recently become a huge fan of using bookmarks. I can make notes to myself, keep a clear TODO list, manage my custom error codes, etc.
Edit: Something like this
05-15-2017 05:16 PM
If you have a later version of LabVIEW, you can use bookmarks in the future. Then you can just go and delete the bookmarks when you are done. I have a ton of #ToDo bookmarks in one my projects, for instance. 😄
Bookmarks are so useful - I've even seen them used as a requirements matrix of sorts.
Sorry about the "words of wisdom" earlier. If I have no idea of the developer's experience level, I always assume a level of 0. Your original post sounded like it could've been written by an inexperienced developer about to tie the noose around their neck and jump off the platform willingly. 😉
05-16-2017 08:26 AM
@BowenM can you post as LabVIEW 2015? Although I could manually enter the contents of the For loop quite easily, I am not sure how to get the "All VIs in Project" reference that feeds it.
Everyone: Thanks for all the fervent support of commenting code. 🙂 I feel equally strong in this regard. However, I feel I should explain my need further. I have a situation where my company is "forced" to give up the code for a project. We are doing so reluctantly. Since we cannot back out of the agreement we would like to provide the code with as little additional support as we can. We could obfuscate the VI names but that would likely cause additional conflict. And yes, some (not all) of the comments are "#CodeRecommended" and #CodeNeeded" bookmarks from the use of LabVIEW Sample Project code. 🙂 It is not an ideal situation but it is what it is. Thanks again for the support and feedback.
05-16-2017 11:26 AM - edited 05-16-2017 11:46 AM
My better-half used to have a sign hanging in her cube that read...
"Real men don't document. If it was hard to write it should be hard to understand."
Ben
05-16-2017 12:12 PM
This might be helpful