[添付ファイル一覧]
[全ページの添付ファイル一覧]
- check_unicode_char2.js
- 格納ファイル名:attach/4D6163726F2FC5EAB9C62F323231_636865636B5F756E69636F64655F63686172322E6A73
- ページ:Macro/投稿/221
- 格納ファイル名:attach/4D6163726F2FC5EAB9C62F323231_636865636B5F756E69636F64655F63686172322E6A73
- MD5ハッシュ値:1f6550cdb82d2748963815258ed5dea4
- サイズ:1.3KB (1358 bytes)
- Content-type:application/octet-stream
- 登録日時:2013/10/29 20:59:46
- アクセス数:347
- MD5ハッシュ値:1f6550cdb82d2748963815258ed5dea4
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
| | var x = parseInt(Editor.ExpandParameter("$x"));
var y = parseInt(Editor.ExpandParameter("$y"));
Editor.SelectAll();
var s = Editor.GetSelectedString(0);
Editor.CancelMode();
var old = Editor.GetClipboard(0);
Editor.SetClipboard(0, s);
s = Editor.GetClipboardByFormat("CF_TEXT", 0, 1);
Editor.SetClipboard(0, old);
var arr = [];
var pos = 0;
var start = 0;
while( pos < s.length ){
var code = s.charCodeAt(pos);
if( code == 0x0a || code == 0x0d ){
if( pos + 1 < s.length && code == 0x0d || s.charCodeAt(pos + 1) == 0x0a ){
pos++;
}
arr[arr.length] = s.substring(start, pos + 1);
start = pos + 1;
}
pos++;
}
if( start < s.length ){
arr[arr.length] = s.substring(start);
}
var targety = 0;
for(; targety < arr.length; targety++ ){
if( Editor.GetLineStr(targety + 1) != arr[targety] ){
break;
}
}
if( targety != arr.length ){
var findpos = 0;
var targetline = Editor.GetLineStr(targety + 1);
var sjisline = arr[targety];
for(; findpos < targetline.length; findpos++ ){
if( sjisline.length <= findpos ){
break;
}
if( targetline.charCodeAt(findpos) != sjisline.charCodeAt(findpos) ){
break;
}
}
Editor.MoveCursor(targety + 1, findpos + 1, 0);
Editor.InfoMsg( "SJIS以外の文字が見つかりました\n" + (targety + 1) + "," + (findpos + 1) );
}else{
Editor.MoveCursor(y, x, 0);
}
|