NppExec dochelp says:
- Now the NPP_EXEC command can pass arguments to the script. These arguments can be accessed in the script through the following macro-variables:
$(ARGC)
,$(ARGV)
,$(ARGV[n])
. Example:npp_exec "script name" param_1 "param 2"
. This example sets the following values for the script:$(ARGC) = 3; $(ARGV) = param_1 "param 2"; $(ARGV[0]) = script name; $(ARGV[1]) = param_1; $(ARGV[2]) = param 2.
But I am not sure where to set it up. Is it in Execute box or in Advanced Option?
For example,
# counter_thread.rb
count = 0
counter_thread = Thread.new do
1.upto(1000000) { count += 1; }
end
counter_thread.join unless ARGV[0]
puts "The counter was able to count up to #{count}."
Test 1 : NppExec runs this fine since no argument
counter_thread.rb
The counter was able to count up to 1000000.
Test 2 : Would like to know settings for the one below . (dont_call_join is an argument here)
counter_thread.rb dont_call_join