Comment detail

税込み価格への修正 (Nested Flatten)
開いている文書から変換。
「与えられた文字列の中から見つけ出し、変更した文字列を返す関数を作る」には沿っていませんが、この方が秀丸マクロらしいと思います。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    disabledraw;
    begingroupundo;
    gofiletop;
    while( true ) {
        if ( code < '0' || code > '9' ) {
            searchdown "[0-9]", regular;
            if( !result ) {
                break;
            }
        }
        #figX = x;
        #figY = y;
        searchdown "[^0-9]", regular;
        if( !result ) {
            gofileend;
        }
        #figure = val( gettext( #figX, #figY, x, y ) );
        beginsel;
        moveto #figX, #figY;
        delete;
        insert str( #figure * 105 / 100 );
    }
    endgroupundo;
    enabledraw;
searchdown2 で。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
    disabledraw;
    begingroupundo;
    gofiletop;
    while( true ) {
        searchdown2 "[0-9]", regular;
        if( !result ) {
            break;
        }
        #figX = x;
        #figY = y;
        searchdown "[^0-9]", regular;
        if( !result ) {
            gofileend;
        }
        #figure = val( gettext( #figX, #figY, x, y ) );
        beginsel;
        moveto #figX, #figY;
        insert str( #figure * 105 / 100 );
    }
    endgroupundo;
    enabledraw;

Index

Feed

Other

Link

Pathtraq

loading...