home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004A.BIN / OLS / CSSH102 / CSSH102.LZH / csshtml / spanreplacer_menu.mac < prev    next >
Text File  |  1999-12-20  |  4KB  |  121 lines

  1. ////////////////////////////////////////////////////////////
  2. // spanreplacer_menu.mac
  3. // Toshiyuki Akutsu <locrian@mbd.sphere.ne.jp>
  4. // Mon, 20 Dec 1999 21:30:54
  5. ////////////////////////////////////////////////////////////
  6.     openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
  7.     if( ! result ) endmacro;
  8.     $__macroPath = getregstr( "MacroPath" );
  9.     closereg;
  10.     if( $__macroPath == "" ) $__macroPath = hidemarudir;
  11.     if( rightstr( $__macroPath, 1 ) != "\\" ) $__macroPath = $__macroPath + "\\";
  12.     $__INI = $__macroPath + "csshtml\\csshtml.ini";
  13. ////////////////////////////////////////////////////////////
  14.  
  15.     writeininum $__INI, "SUBMACRO", "EXECUTE", 0;
  16.     call initializeVariables;
  17.     RE_MENU:
  18.     menuarray $__MI,#__EXIT + 1;
  19.     ##item = result - 1;
  20.     if( ##item < 0 || ##item == #__EXIT ){
  21.         endmacro;
  22.     }else if( ##item == #__RESET ){
  23.         call resetReplacement;
  24.         goto RE_MENU;
  25.     }else if( ##item == #__EXECUTE ){
  26.         writeininum $__INI, "SUBMACRO", "EXECUTE", 1;
  27.         endmacro;
  28.     }
  29.     call setReplacementOfSpan ##item;
  30.  
  31. goto RE_MENU;
  32. //end spanreplacer_menu.mac
  33. ////////////////////////////////////////////////////////////
  34. setReplacementOfSpan:
  35.     ##class = ##1;
  36.     $$class = str(##class);
  37.  
  38.     if( $__ROS[##class][0] == "" )
  39.         $$default = "< CLASS="+ $__Q + $__CLASS[##class] + $__Q + ">";
  40.     else
  41.         $$default = $__ROS[##class][0];
  42.  
  43.     $$mes = $__NAME[##class] + "\n開始タグを入力して下さい。";
  44.     $$tmpTag[0] = input($$mes, $$default);
  45.     if( !result ){
  46.         return;
  47.     }else if( $$tmpTag[0] == "" ){
  48.         ##i = ##class;
  49.         $__ROS[##i][0] = "";
  50.         writeinistr $__INI,"REPLACEMENT_OF_SPAN_0", $$class,"";
  51.         $$tmp = midstr($__ACC, 3 * ##i, 3)+ $__CLASS[##i] +" "+ $__NAME[##i];
  52.         $__MI[##i] = $$tmp + " > そのまま";
  53.         return;
  54.     }
  55.     $$mes = $$tmpTag[0] + "★\n終了タグを入力して下さい。";
  56.     $$tmpTag[1] = input($$mes, "</>");
  57.     if( (result==0) || ($$tmpTag[1]=="") ) return;
  58.  
  59.     ##i = ##class;
  60.     $__ROS[##i][0] = $$tmpTag[0];
  61.     $__ROS[##i][1] = $$tmpTag[1];
  62.     writeinistr $__INI,"REPLACEMENT_OF_SPAN_0", $$class,$__ROS[##i][0];
  63.     writeinistr $__INI,"REPLACEMENT_OF_SPAN_1", $$class,$__ROS[##i][1];
  64.  
  65.     $$tmp = midstr($__ACC,3 * ##i, 3) + $__CLASS[##i] + " " + $__NAME[##i];
  66.     $__MI[##i] = $$tmp + " > " + $__ROS[##i][0] + "★" + $__ROS[##i][1];
  67.  
  68. return;
  69. // end setReplacementOfSpan
  70. ////////////////////////////////////////////////////////////
  71. //最初の変数の取得と、メニューの構築
  72. initializeVariables:
  73.     $__ACC = "&1 &2 &3 &4 &5 &6 &7 &8 &9 &A &B &C &D &E &F &R &M &Q ";
  74.     #__SIZE = getininum($__INI,"REPLACEABLE_SPAN_CLASS","SIZE");
  75.     ##i = 0;
  76.     while( ##i < #__SIZE )
  77.     {
  78.         $$num = str(##i);
  79.         $__CLASS[##i] = getinistr($__INI,"REPLACEABLE_SPAN_CLASS",$$num);
  80.         $__NAME[##i] = getinistr($__INI,"REPLACEABLE_SPAN_NAME",$$num);
  81.         $__ROS[##i][0] = getinistr($__INI,"REPLACEMENT_OF_SPAN_0",$$num);
  82.         $__ROS[##i][1] = getinistr($__INI,"REPLACEMENT_OF_SPAN_1",$$num);
  83.         $$tmp = midstr($__ACC, 3 * ##i, 3)+ $__CLASS[##i] +" "+ $__NAME[##i];
  84.         if( $__ROS[##i][0] == "" ) $__MI[##i] = $$tmp + " > そのまま";
  85.         else $__MI[##i] = $$tmp + " > " + $__ROS[##i][0] + "★" + $__ROS[##i][1];
  86.         ##i = ##i + 1;
  87.     }
  88.  
  89.     #__RESET = #__SIZE;
  90.     #__EXECUTE = #__SIZE + 1;
  91.     #__EXIT = #__SIZE + 2;
  92.     ##i = #__RESET;
  93.     $__MI[##i] = midstr($__ACC,3 * ##i,3) + "リセット";
  94.     ##i = ##i + 1;
  95.     $__MI[##i] = midstr($__ACC,3 * ##i,3) + "SPAN置換 実行";
  96.     ##i = ##i + 1;
  97.     $__MI[##i] = midstr($__ACC,3 * ##i,3) + "設定だけで戻る ( ESC )";
  98.  
  99.     ##i = getininum($__INI,"CSSHTML","__DQUOT");
  100.     if( ##i ) $__Q = "\"";
  101.     else $__Q = "'";
  102.  
  103. return;
  104. // end initializeVariables
  105. ////////////////////////////////////////////////////////////
  106. resetReplacement:
  107.     question "現在の設定をリセットします。\nよろしいですか?";
  108.     if( ! result ) return;
  109.     ##i = 0;
  110.     while( ##i < #__SIZE ){
  111.         $$num = str(##i);
  112.         $__ROS[##i][0] = "";
  113.         writeinistr $__INI,"REPLACEMENT_OF_SPAN_0",$$num,"";
  114. $__MI[##i] = midstr($__ACC,3 * ##i,3)+$__CLASS[##i]+" "+ $__NAME[##i]+" > そのまま";
  115.         ##i = ##i + 1;
  116.     }
  117.  
  118. return;
  119. // end resetReplacement
  120. ////////////////////////////////////////////////////////////
  121.