home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1996 February / VPR9602A.ISO / fwindows / archive / dtt250.lzh / DTTRENUM.MAC < prev    next >
Text File  |  1995-08-21  |  853b  |  42 lines

  1. // 自動番号付けマクロ V1.00 for 秀丸エディタ(斉藤秀夫氏作)
  2. //  所望範囲を行単位で選択し、このマクロを実行
  3. //  例)実行前       実行後
  4. //   ,winfile.exe    0=,winfile.exe
  5. //   8=,control.exe → 1=,control.exe
  6. //   4=,cal.exe     2=,cal.exe
  7.  
  8. if (basename!="dtt.ini") {
  9.     message "dtt.ini 編集専用マクロです" ;
  10.     endmacro ;
  11. }
  12.  
  13. #lct=seltopy ;
  14. #endline=selendy ;
  15. #insNum=0 ;
  16. escape ;
  17.  
  18. while (#lct<#endline) {
  19.     $sbuf=gettext(0,#lct,5,#lct) ;
  20.     #chct=0 ;
  21.     #insflag=0 ;
  22.     while (#chct<3) {
  23.         $ch=midstr($sbuf,#chct,1) ;
  24.         if ($ch=="=") {
  25.             moveto 0,#lct ;
  26.             beginsel ;
  27.             moveto #chct+1,#lct ;
  28.             delete ;
  29.             insert str(#insNum)+"=" ;
  30.             #insflag=1 ;
  31.             break ;
  32.         }
  33.         #chct=#chct+1 ;
  34.     }
  35.     if (!#insflag) {
  36.         moveto 0,#lct ;
  37.         insert str(#insNum)+"=" ;
  38.     }
  39.     #insNum=#insNum+1 ;
  40.     #lct=#lct+1 ;
  41. }
  42.