Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disabling Code.
#1
I think there should be a command to quickly disable and enable sections of code.

It'd be easy...just grab a string with _s.getsel() break it into its separate lines and add some sort of marker...like ";_" that way it would differentiate between commented text and disabled text.

Then there could be a way to enable text that would just find and replace ";_" with ""

Just add a keyboard command and a button to the menu.
#2
Function Disable_Text
Trigger CSa     Help - how to add the trigger to the macro
Code:
Copy      Help
str s.getsel()
ARRAY(str) arr = s
for(int'i 0 arr.len)
,s.format(";_%s[]" arr[i])
,key (s)

Function Enable_Text
Trigger CSAa     Help - how to add the trigger to the macro
Code:
Copy      Help
str s.getsel()
ARRAY(str) arr = s
for(int'i 0 arr.len)
,arr[i].findreplace(";_")
,key (arr[i])
,outp "[]"

This is what I've got so far...is there any better way to do this?
Mainly the big problem is that this spits it out line by line...which eats up a lot of undo steps.
It'd be better if it set text as one block chunk.


Forum Jump:


Users browsing this thread: 1 Guest(s)