cols = InputBox("クオートする列を指定してください。"); if (cols == "") { MessageBox("キャンセルしました。"); return; } cols = "," + replace(cols, " ", "") + ","; // 各行をループ for (y=1; y<=Bottom; y++) { for (x=1; x<=Right; x++) { // 2 つめのデータ以降は「,」 を出力 if (x > 1) { write(","); } if (y == 1 || pos(cols, "," + x + ",") > 0) { // "" で囲んで出力。" は "" に変換。 write("\""); write(replace([x,y], "\"", "\"\"")); write("\""); } else { // そのまま出力。 write([x,y]); } } writeln(); }