おじゃまします。
まずは、マクロを「$(nth,」が有る場所で改行してみます。
*^C^C$m=setenv;to;0;
$(nth,$(getenv,to),offset;;^Xオブジェクトを選択^X\;undo;be;setenv;to;1;select;non;@;non;@;;setenv;to;4,undo;m;stretch;c;non;@;'setenv;to;2;\r,,,,,)
$(nth,$(getenv,to),,,offset;;^Xオブジェクトを選択:[UNDO(R)]^X\$M="""$(if,$(getvar,cmdactive),;setenv;to;1;select;non;@;non;@;;setenv;to;4,undo;b;setenv;to;2)""",,,,)
$(nth,$(getenv,to),,,,,;p1;$(getvar,lastpoint);;to;5;undo;m;select;c;end+ins+nod;@;end+ins+nod;@;r;$(getvar,lastpoint);;setenv;to;6,stretch;c;end+ins+nod;@;end+ins+nod;@;;end+ins+nod;@;\setenv;to;2,,)
$(nth,$(getenv,to),,,,,,,-layer;n;s-damy;;chprop;p;;la;s-damy;;-layer;LO;s-damy;;stretch;c;end+ins+nod;@;end+ins+nod;@;;end+ins+nod;@;'-layer;u;s-damy;;--キャンセル不可--[UNDO(R)]^X\setenv;to;7,)
$(nth,$(getenv,to),,,,,,,,copybase;non;0<0;p;;undo;b;erase;non;$(getenv,p1);;pasteclip;non;0<0;setenv;to;2)^M
次に、$(nth,$(getenv,to),以降でネストされていないカンマ部分で改行してみます。
*^C^C$m=setenv;to;0;
$(nth,$(getenv,to),offset;;^Xオブジェクトを選択^X\;undo;be;setenv;to;1;select;non;@;non;@;;setenv;to;4
,undo;m;stretch;c;non;@;'setenv;to;2;\r,,,,,)
$(nth,$(getenv,to),,,offset;;^Xオブジェクトを選択:[UNDO(R)]^X\$M="""$(if,$(getvar,cmdactive),;setenv;to;1;select;non;@;non;@;;setenv;to;4,undo;b;setenv;to;2)""",,,,)
$(nth,$(getenv,to),,,,,;p1;$(getvar,lastpoint);;to;5;undo;m;select;c;end+ins+nod;@;end+ins+nod;@;r;$(getvar,lastpoint);;setenv;to;6
,stretch;c;end+ins+nod;@;end+ins+nod;@;;end+ins+nod;@;\setenv;to;2,,)
$(nth,$(getenv,to),,,,,,,-layer;n;s-damy;;chprop;p;;la;s-damy;;-layer;LO;s-damy;;stretch;c;end+ins+nod;@;end+ins+nod;@;;end+ins+nod;@;'-layer;u;s-damy;;--キャンセル不可--[UNDO(R)]^X\setenv;to;7,)
$(nth,$(getenv,to),,,,,,,,copybase;non;0<0;p;;undo;b;erase;non;$(getenv,p1);;pasteclip;non;0<0;setenv;to;2)^M
これで1段落づつに分けられました。
分かり易い様に頭に、$(nth,$(getenv,to),を追加します。 お尻もカッコでくくります。
*^C^C$m=setenv;to;0;
$(nth,$(getenv,to),offset;;^Xオブジェクトを選択^X\;undo;be;setenv;to;1;select;non;@;non;@;;setenv;to;4,,,,,,)
$(nth,$(getenv,to),,undo;m;stretch;c;non;@;'setenv;to;2;\r,,,,,)
$(nth,$(getenv,to),,,offset;;^Xオブジェクトを選択:[UNDO(R)]^X\$M="""$(if,$(getvar,cmdactive),;setenv;to;1;select;non;@;non;@;;setenv;to;4,undo;b;setenv;to;2)""",,,,)
$(nth,$(getenv,to),,,,,;p1;$(getvar,lastpoint);;to;5;undo;m;select;c;end+ins+nod;@;end+ins+nod;@;r;$(getvar,lastpoint);;setenv;to;6,,,)
$(nth,$(getenv,to),,,,,,stretch;c;end+ins+nod;@;end+ins+nod;@;;end+ins+nod;@;\setenv;to;2,,)
$(nth,$(getenv,to),,,,,,,-layer;n;s-damy;;chprop;p;;la;s-damy;;-layer;LO;s-damy;;stretch;c;end+ins+nod;@;end+ins+nod;@;;end+ins+nod;@;'-layer;u;s-damy;;--キャンセル不可--[UNDO(R)]^X\setenv;to;7,)
$(nth,$(getenv,to),,,,,,,,copybase;non;0<0;p;;undo;b;erase;non;$(getenv,p1);;pasteclip;non;0<0;setenv;to;2)^M
うん。あってるみたいですね。
ヘルプ等を見ると、
$(nth, which, arg0 , arg1 , arg2 , arg3 , arg4 , arg5 , arg6 , arg7)
これが本来の使い方。
でもこれが長すぎる場合、途中でマクロを分割させます。
$(nth, which, arg0 , arg1 , arg2 , arg3 , arg4 , arg5) $(nth, which, , , , , , , arg6 , arg7)
例えば、which=1だった場合、前半の$(nth, which, arg0 , arg1 , arg2 , arg3 , arg4 , arg5)にはarg1の命令が有るのでそれを実行するが、後半の$(nth, which, , , , , , , arg6 , arg7)は命令が無いので素通り。
そして、which=6だった場合、前半の$(nth, which, arg0 , arg1 , arg2 , arg3 , arg4 , arg5)は命令が無いので素通りし、後半の$(nth, which, , , , , , , arg6 , arg7)にはarg6の命令が有るのでそれを実行。
まだ文字数が多いなら、もう一か所分割・・・と繰り返し全部分割してしまうと、
$(nth,which,arg0)$(nth,which,,arg1)$(nth,which,,,arg2)$(nth,which,,,,arg3)$(nth,which,,,,,arg4)$(nth,which,,,,,,arg5)$(nth,which,,,,,,,arg6)$(nth,which,,,,,,,,arg7)
となる訳です。
改行入れると
$(nth,which,arg0)
$(nth,which,,arg1)
$(nth,which,,,arg2)
$(nth,which,,,,arg3)
$(nth,which,,,,,arg4)
$(nth,which,,,,,,arg5)
$(nth,which,,,,,,,arg6)
$(nth,which,,,,,,,,arg7)
こうなります。
分かり易くするため? 最後にもカンマを足します。
$(nth,which,arg0,,,,,,,)
$(nth,which,,arg1,,,,,,)
$(nth,which,,,arg2,,,,,)
$(nth,which,,,,arg3,,,,)
$(nth,which,,,,,arg4,,,)
$(nth,which,,,,,,arg5,,)
$(nth,which,,,,,,,arg6,)
$(nth,which,,,,,,,,arg7)
つまり、文字数が多くない物を無理やり区切って段落分けする必要は無いんです。
1段落づつに区切った方が解析する人は見易いかもしれませんが、作る方はどっちでもいいです。
1段落づつに区切る事で、総文字数が増えてしまうデメリットもあります。
- Lon
- 2017/12/22 (Fri) 16:52:13