home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 January (DVD) / VPR980100.ISO / OLS / WIN32 / KAKIMAC / KAKIMAC3.LZH / K_BASE01.MAC next >
Text File  |  1994-06-30  |  9KB  |  239 lines

  1. //【マクロ名】 k_base01.mac by 水銀水(Suigwinsui) / 小田 明夫 (HGD01603) 94/06/27
  2. //【主な用途】日本語文書作成支援「書きマクロ」シリーズ Vol.3.#K1 Ver.2(高速化版)
  3. //              秀丸に、「文字情報データベース」機能を追加する。(かなりの長文も可能)
  4. //【使用対象】秀丸 for Windows 上で日本語文章を快適に処理したい全てのみなさま。
  5. //【機能概略】(1)短文(長文も)、短文群を自由に秀丸上から扱える。
  6. //            (2)1行だけの単文だけでなく、改行を含む複数行にわたる短文群も登録、挿入できる。
  7. //            (3)使用中の秀丸上から別の秀丸を起動しなくて良い(ちょっとだけ裏技です(^o^))
  8. //            (4)順番などは本マクロが強力に管理するので、データファイルを自由に書き換えられる。
  9. //                   事前のセッティングは全く不要。(本マクロを実行するだけ)
  10. //            (5)分野別に9つのブックを持つ。1ブックに100個の索引、索引の本文は長文にも耐える
  11. //            (6)ブック、索引などは、必要に応じて追加も自由。
  12. //            (7)以上の機能から、忘備録、メモ帳、住所録、通信文のID等、自由にカスタマイズして幅広く利用できる。
  13. //            (8)自然な思考の流れを妨げないで入出力を一本化することに成功したインターフェイス(^^;。
  14. //【使用法】  
  15. //          通常のマクロと同じ。できれば、マクロ登録後、キー割当を行うと、一層快適に k_BASE が
  16. //          利用する事が可能となり、「 k_BASE なしの生活なんて・・」とおしゃって頂ければ幸いです(^^)
  17. //
  18. #disp_j = 0;    //0:output 1:input
  19. $disp_s  = "\n\n制作協力:アシュレイ さん";
  20. $disp_m1 = "(C) 1994  My Friend Office -A.Oda-";
  21. ///////////////////////////<< BOOK のカスタマイズをしたい場合の手引き>>///////////////////////
  22. // BOOK の名称を書き換えたい人は、(1)windows ディレクトリにある kakimem?.ini をすべて消去した上で(kakimeme?.iniの初期化)
  23. //(2)k_BASE01.mac 31行から39行までの BOOK 名を書き換えてください。(表示メニューの変更)
  24. //ただし、各行末の「";」は絶対に削除しないように注意して下さい!!!
  25. while(1){
  26.     if (#disp_j==0){$bh = "■";$bht="=【抽出BOOK選択】";$bhe="【現在、抽出中。でも新しいデータを入力したくなった】";
  27.     $bhs="データ抽出";}
  28.     else {$bh = "●";$bht="=【入力BOOK選択】";$bhe="【現在、入力中。でも記録済データを文書に挿入したい】";
  29.     $bhs="データ入力";}
  30.     $BTitle[0] = $bh+"文字情報データベース/ k_BASE Ver.1 "+$bh+$bht;
  31.     $BTitle[1] = $bh+" (1)BOOK1---雑記帳";
  32.     $BTitle[2] = $bh+" (2)BOOK2---住所録";
  33.     $BTitle[3] = $bh+" (3)BOOK3---定型短文集";
  34.     $BTitle[4] = $bh+" (4)BOOK4---通信用定型文字列";
  35.     $BTitle[5] = $bh+" (5)BOOK5---夜の紳士・淑女録 (~_~;)";
  36.     $BTitle[6] = $bh+" (6)BOOK6---ショップガイド";
  37.     $BTitle[7] = $bh+" (7)BOOK7---マクロ常用ルーチン集";
  38.     $BTitle[8] = $bh+" (8)BOOK8---未設定";
  39.     $BTitle[9] = $bh+" (9)BOOK9---未設定";
  40.     $BTitle_ch = $bh+$bhe;
  41.     $BTitle_e1  = "------------------------------>>終了:[ESC]-->>";
  42.     $BTitle_b1 = "      "+$disp_m1;
  43.     #p_s = 0;
  44.         menu $BTitle[0],$BTitle[1],$BTitle[2],$BTitle[3],$BTitle[4],$BTitle[5],$BTitle[6],
  45.         $BTitle[7],$BTitle[8],$BTitle[9],$BTitle_e1,$BTitle_ch,$BTitle_b1;
  46.         if (result == 11||result == 0 )endmacro;
  47.         if (result == 1 )continue;
  48.         if (result == 13){call m;continue;}
  49.         if (result == 12){
  50.             if (#disp_j == 0)#disp_j = 1;
  51.             else #disp_j = 0;
  52.             continue;
  53.         }
  54.         $cn0 = str(result -1);
  55.         if (val($cn0) >= 1 && val($cn0) <= 10){
  56.             $BookName = "kakimem"+$cn0+".ini";
  57.             if (#disp_j == 0)call kakimacro_chr_dB $BookName;
  58.             else if(#disp_j == 1)call kakimacro_chr_in $BookName;
  59.         }
  60. }
  61. kakimacro_chr_dB:
  62. $$Hsp = "  ";
  63. $dpa="(C)My Friend Office -A.Oda-";
  64. #file_yn = 0;
  65. #n = 1;
  66. while(1){// TLC=TitleListContents
  67.     $TLC[#n] = getinistr($BookName,"TitleList",str(#n));
  68.     if ($TLC[#n] == "" )break;
  69.     #n = #n + 1;
  70. }
  71. #TitleListMaxNumber = #n - 1;
  72. $TitleHead = $bh+$BTitle[val($cn0)];
  73. $Title[0]  = "■索引表示(第1画面)>>>>次の索引画面へ>>>";
  74. $Title[10] = "■索引表示(第2画面)■>>>次の索引画面へ>>>";
  75. $Title[20] = "■索引表示(第3画面)■>>>次の索引画面へ>>>";
  76. $Title[30] = "■索引表示(第4画面)■>>>次の索引画面へ>>>";
  77. $Title[40] = "■索引表示(第5画面)■>>>次の索引画面へ>>>";
  78. $Title[50] = "■索引表示(第6画面)■>>>次の索引画面へ>>>";
  79. $Title[60] = "■索引表示(第7画面)■>>>次の索引画面へ>>>";
  80. $Title[70] = "■索引表示(第8画面)■>>>次の索引画面へ>>>";
  81. $Title[80] = "■索引表示(第9画面)■>>>次の索引画面へ>>>";
  82. $Title[90] = "■索引表示(第10画面)■>>>次の索引画面へ>>>";
  83. $Title_b2 =   "<<<<<<<<<<<前の索引画面に戻る<<<<<<<<<<<";
  84. $Title_e2  =  "<<-----------BOOK・入出力、切替画面<<<<";
  85. #p_s = 0;
  86. $disp_e = $Title0;
  87. while(1){
  88. menu $TitleHead,$Title[#p_s],$$Hsp+$TLC[#p_s +1],$$Hsp+$TLC[#p_s +2],$$Hsp+$TLC[#p_s +3],$$Hsp+$TLC[#p_s +4],$$Hsp+$TLC[#p_s +5],$$Hsp+$TLC[#p_s +6],$$Hsp+$TLC[#p_s +7],$$Hsp+$TLC[#p_s +8],$$Hsp+$TLC[#p_s +9],$$Hsp+$TLC[#p_s +10],$Title_b2,$Title_e2;
  89.     if (result == 0 )endmacro;
  90.     if (result == 1 )continue;
  91.     if (result == 14){
  92.         // $TLC[*] の初期化
  93.         #n = 1;
  94.         while(#n<=#TitleListMaxNumber){// TLC=TitleListContents
  95.             $TLC[#n] = "";
  96.             #n = #n + 1;
  97.         }
  98.         #TitleListMaxNumber = 0;
  99.         return;
  100.     }
  101.     if (result == 13){
  102.         if(#p_s == 0){#p_s=90;continue;}
  103.         else {#p_s = #p_s-10;continue;}
  104.     }
  105.     #LN = (result -2)+#p_s;
  106.     if (#LN >= #p_s + 1 && #LN <= #p_s +10) call jump_mess #LN;
  107.     if(#p_s < 90 )#p_s = #p_s +10;
  108.     else #p_s = 0;
  109. }
  110. jump_mess:
  111. ##nj = ##1;
  112. //その画面のカーソル位置に記録がない場合は自動的にページをめくる(次の画面へ移る)。
  113. if ( ##nj > #TitleListMaxNumber)return;
  114. ##nj2 = 1;
  115. $disp_aide0 = "<索引>--------------"+"\n  ["+$TLC[##nj]+"]"+"\n<内容>--------------";
  116. $disp_aide1 = "  ";
  117.     while(1){// すべて
  118.         $TCe[##nj][##nj2] = getinistr($BookName,$TLC[##nj],str(##nj2));
  119.         $disp_aide1 = $disp_aide1 +"\n  "+ $TCe[##nj][##nj2];
  120.         if ( $TCe[##nj][##nj2] == "" )break;
  121.         ##nj2 = ##nj2 + 1;
  122.     }
  123.     #MaxTCe = ##nj2 -1;
  124. question $disp_aide0+$disp_aide1+"\n-------------------"+"\n●出力しますか  ???....."+
  125. "\n"+$dpa;
  126. if (result) call ins_tanbun ##nj;
  127. else {
  128.     if(#p_s == 0){#p_s=90;}
  129.     else {#p_s = #p_s-10;}
  130.     return;
  131. }
  132. return;
  133. m:
  134.     message "「書きマクロ」シリーズ!!    \n只今、全3集、公開中
  135.     \n使ってネ(^^ゞ..."+$disp_s+
  136.     "\n制作:水銀水(Suigwinsui)\n小田 明夫(HGD01603)\n   1994/06/28";
  137.     return;
  138. ins_tanbun:
  139. ##nj = ##1;
  140. ##nj2 = 1;
  141.     while(1){// すべて
  142.         if ( $TCe[##nj][##nj2] == "" )endmacro;
  143.         insert $TCe[##nj][##nj2]+"\n";
  144.         ##nj2 = ##nj2 + 1;
  145.     }
  146. endmacro;
  147. return;
  148. endmacro;
  149. #file_yn = 0;
  150. kakimacro_chr_in:
  151. $TitleName = input("●索引の入力●"+$BTitle[val($cn0)]);
  152. if(!result)return;
  153. if($TitleName == "") return;
  154. if($TitleName == "TitleList") return;// 索引名には使用禁
  155. #n = 1;
  156. while(1){
  157.     $TitleListContents[#n] = getinistr($BookName,"TitleList",str(#n));
  158.     if ($TitleListContents[#n] == "" )break;
  159.     #n = #n + 1;
  160. }
  161. #TitleListMaxNumber = #n - 1;
  162. // 既に [TitleList] に登録されてあるタイトルと 入力されたタイトル$TitleName の比較
  163. #n = 1;
  164. while(1){
  165.     if ($TitleName == $TitleListContents[#n]){
  166.         #file_yn = 1;
  167.         #TitleListSameNumber = #n;    //TitleList に合致したリストがあった→その番号
  168.         break;
  169.     }
  170.     if (#n > #TitleListMaxNumber){        // TitleList にはなかった(新しいタイトルである)
  171.         #file_yn = 0;
  172.         
  173.     break;
  174.     }
  175.     #n = #n + 1;
  176. }
  177. if (#file_yn == 1 ){//既存のタイトルであれば、その最大行番号 TitleContentsMaxNumber を取得
  178.     #n = 1;
  179.     while(1){
  180.         $TitleContents[#n] = getinistr($BookName,$TitleName,str(#n));
  181.         if ($TitleContents[#n] == "" )break;
  182.         #n = #n + 1;
  183.     }
  184.     #TitleContentsMaxNumber = #n -1;
  185.     #NewInputNumber = #TitleContentsMaxNumber +1;
  186.     #n = 1;
  187.     $disp_aid0 = "■現在の記録情報■\n"+"["+$TitleName+"] "+"\n";
  188.     $disp_aid1 = "";
  189.     while (1){
  190.         $disp_aid1 = $disp_aid1+$TitleContents[#n]+"\n";
  191.         if ($TitleContents[#n] == "" )break;
  192.         #n = #n + 1;
  193.     }
  194.     question $disp_aid0+"\n"+$disp_aid1+"\n●追加しますか?";
  195.     if (!result)return;
  196.     
  197. }else{
  198.     #TitleContentsMaxNumber = 1;    // 今回、操作をはじめる最初のラインナンバー
  199.     #NewInputNumber = 1;
  200. }
  201. if (#file_yn == 1)$disp_j = "【追加】";
  202. else $disp_j = "【新規】";
  203.  
  204. //message str(#TitleContentsMaxNumber);
  205. #n = #NewInputNumber;
  206. while (1){
  207.     // disply title setting section
  208. //全表示が理想的だがダイアログボックスには3行しか表示できないのが残念!!!
  209.     $disp_aid = "["+$TitleName+"] (2行参照)   "+$disp_j+"\n"+
  210.     $TitleContents[#n-2]+"\n"+$TitleContents[#n-1];
  211.     $TitleContents[#n] = input($disp_aid);
  212.     if (!result) return;
  213.     if ($TitleContents[#n] == "" )break;
  214.     #n = #n + 1;
  215. }
  216. #MaxLineNumberNew = #n -1; // 新規にどこまで番号があがったか?
  217. // 入力データの正誤確認
  218. $disp_str = "■下記の情報でいいですか?■"+"\n["+$TitleName+"]"+$disp_j+"\n";
  219. #n = #NewInputNumber;
  220. while (#n <= #MaxLineNumberNew){
  221.     $disp_str = $disp_str+"\n"+$TitleContents[#n];
  222.     #n = #n + 1;
  223. }
  224. question $disp_str;
  225. if ( !result )return;
  226. #n = #NewInputNumber;
  227. if (result == yes ){
  228.     if (#file_yn){    // タイトルの記入、非記入
  229.     } else {    // ない場合は新規に追加
  230.     writeinistr $BookName,"TitleList",str(#TitleListMaxNumber+1),$TitleName;
  231.     }
  232.     while (#n <= #MaxLineNumberNew){
  233.             writeinistr $BookName,$TitleName,str(#n),$TitleContents[#n];
  234.             #n = #n + 1;
  235.     }
  236. }else return;
  237. return;
  238. endmacro;
  239.