NppExec 文档帮助 说:
- 现在 NPP_EXEC 命令可以将参数传递给脚本。可以通过以下宏变量在脚本中访问这些参数:
$(ARGC)
,$(ARGV)
,$(ARGV[n])
. 示例:npp_exec "script name" param_1 "param 2"
。此示例为脚本设置以下值:$(ARGC) = 3; $(ARGV) = param_1 "param 2"; $(ARGV[0]) = script name; $(ARGV[1]) = param_1; $(ARGV[2]) = param 2.
但我不确定在哪里设置它。它是在执行框中还是在高级选项中?
例如,
# 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}."
测试 1:NppExec 运行良好,因为没有参数
counter_thread.rb
The counter was able to count up to 1000000.
测试2:想知道下面的设置。(dont_call_join 是这里的一个论点)
counter_thread.rb dont_call_join