LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

commenting and code format

Too bad it's not possible to wrtite macros.. I've seen them posted as *.ini files in this board, so I figured it was possible.

Ok, the functionality I'm requesting is as follows:
  • The user selects a range (various number of rows) in the source code editor
  • The user hits a shortcut key/starts a macro or whatever and the code becomes commented out (so far I could have used CTRL+E)
  • The user saves the document and re-opens the project the next day.
  • Now the user selects the same range (that was earlier commented out) and user hits a shortcut key/starts a macro etc. And the block of code becomes "un-commented" (as far as I know, this can not be done using any builtin functionality)
In short: the functionality I'm looking for would add/remove "//" at the beginning of each selected line..
Please ask if this didn't clarify enough Smiley Wink
---
Best regards
Peder Schmedling
0 Kudos
Message 11 of 15
(1,731 Views)

You can do this using Find-Replace and regular expressions. Here is an INI file with simple versions of some macros that do this. You can import into CVI. Note that you can use more complex regular expressions if you want more sophisticated commenting-uncommenting logic. I have gotten used to these simple macros.

 

Message 12 of 15
(1,709 Views)
NOTE - for the above macros to work you must have the Regular Expressions checked in the Find/Replace dialogs.
0 Kudos
Message 13 of 15
(1,707 Views)
Hi Pedro,
 
Also, if you would like to see this feature implemented in a future release of CVI, you can submit a suggestion at our Product Suggestion Center.

We take our customer's feedback very seriously and every suggestion is evaluated by our R&D team.

Thanks!
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 14 of 15
(1,687 Views)
Thanks Jervin_J Smiley Happy
This seems to do the job. Actually regular expressions where automatically checked when I ran these macros, so I just have to uncheck it when I do a manual search (haven't got to the point where I'm steady in regular expressions yet).

Thanks again, this will make my day much easier Smiley Wink
---
Best regards
Peder Schmedling
0 Kudos
Message 15 of 15
(1,671 Views)