Is there any way to comment out multiple lines in krl without have to do ; on each line, I'm using kcp2 controller.
thanks
Is there any way to comment out multiple lines in krl without have to do ; on each line, I'm using kcp2 controller.
thanks
Unfortunately not
There is a sort of workaround, if you move the program to a computer and open it with OrangeEdit. In OE, if you highlight a series of lines, there's an option in the Edit menu to comment or un-comment all of them.
If you need to stay on the pendant, the quick&dirty way to skip over a group of lines is to put them between an IF FALSE and ENDIF. That'll skip over all the lines in between, but if you change FALSE to TRUE, you can "re-activate" those lines of code.
or on the pendant just put a an IF statement to jump the lines you no longer need
IF FALSE THEN
lines to jump
ENDIF
I know this is an old thread, but it came up in a search. In the absence of built in multi line commenting in Work Visual, you can comment out a single line or block of lines by highlighting them and then pressing Ctrl+Shift+C. To uncomment it's Ctrl+Shift+V
yes... those are the shortcuts in WorkVisual. not sure why you say it is absent (typo?).
btw WoV does not handle this correctly either - at least in my currently used WoV version.
if one selects block of code that contains semicolon (such as ;FOLD ) then additional semicolon is NOT added. it is only added to some lines (ones that do not contain semicolon).
this completely ruins code block if it contains inline form instructions. so when trying to reverse back by uncommenting all the FOLD/ENDFOLD are stripped of semicolon...
uncommenting function (Ctrl+Shift+V) should never remove semicolon if what follows is keyword FOLD or ENDFOLD.
so if one is to try an external editor, it would be is better to just use NPP and do a search and replace.
btw. this topic was about commenting on a KRC2 teach pendant. so using WoV for this task would be possible but ... quite a detour. it would be simpler and faster to use NPP.
the quickest way on teach pendant is to use IF block.
if debugging, one can use variable or an output so it is easy to toggle it without repeated editing.
but... this is not perfect either because it does NOT comment out code... that means it would still not work if the code block contains syntax errors, missing declarations etc.
By absent I meant the ability to comment out every line between two points similar to the way a FOLD works. For example,
### this would initiate the comment block
Every
Line
Here
Would
Be
Commented
Out
### this would end the comment block
fold does not comment code out. it folds it so that it is taking less display area. content is still executed the same way regardless if fold is open or not.
what you are showing in the example is a very nice thing but unfortunately it does not exist in KRL...
the best way around this is to make the code modular. then one can comment out just subprogram call.