ASCII印字可能文字の表を挿入
- ページ: Macro/投稿
- 作者: みけCAT?
- カテゴリー: js
- 投稿日: 2014-01-18 (土) 10:28:11
メッセージ
ASCII印字可能文字の表を挿入します。
縦を上位4ビット、横を下位4ビットとした表のサンプル
| 0 1 2 3 4 5 6 7 8 9 A B C D E F
--+--------------------------------
2 | ! " # $ % & ' ( ) * + , - . /
3 | 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
4 | @ A B C D E F G H I J K L M N O
5 | P Q R S T U V W X Y Z [ \ ] ^ _
6 | ` a b c d e f g h i j k l m n o
7 | p q r s t u v w x y z { | } ~
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| |
var hexChars="0123456789ABCDEF";
var newLine="\r\n";
var out="";
switch(GetLineCode()) {
case 0: newLine="\r\n";break;
case 1: newLine="\r";break;
case 2: newLine="\n";break;
}
out+=" |";
for(var i=0;i<16;i++)out+=" "+hexChars.charAt(i);
out+=newLine;
out+="--+";
for(var i=0;i<16;i++)out+="--";
out+=newLine;
for(var i=2;i<8;i++) {
out+=hexChars.charAt(i)+" |";
for(var j=0;j<16;j++) {
var c=(i<<4)|j;
if(c<127)out+=" "+String.fromCharCode(c);
}
out+=newLine;
}
InsText(out);
|
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| |
var hexChars="0123456789ABCDEF";
var newLine="\r\n";
var out="";
switch(GetLineCode()) {
case 0: newLine="\r\n";break;
case 1: newLine="\r";break;
case 2: newLine="\n";break;
}
out+=" |";
for(var i=2;i<8;i++)out+=" "+hexChars.charAt(i);
out+=newLine;
out+="--+";
for(var i=2;i<8;i++)out+="--";
out+=newLine;
for(var i=0;i<16;i++) {
out+=hexChars.charAt(i)+" |";
for(var j=2;j<8;j++) {
var c=(j<<4)|i;
if(c<127)out+=" "+String.fromCharCode(c);
}
out+=newLine;
}
InsText(out);
|