Macro/投稿/183 の変更点

http://sakura.qp.land.to/?Macro%2F%C5%EA%B9%C6%2F183


Top > Macro > 投稿 > 183
  • 追加された行はこの色です。
  • 削除された行はこの色です。
  • Macro/投稿/183 へ行く。

* 物理桁位置移動 [#g36331eb]
-ページ: [[Macro/投稿]]
-作者: [[maru]]
-カテゴリー: vbs
-投稿日: 2007-11-14 (水) 07:24:45

** メッセージ [#od990f40]
#code(vbscript){{
'-------------------
'GoToColm.vbs
'指定の桁に移動
'>>data:6460 じゅうじ-改
'-------------------

Option Explicit

Call main

Private Sub main()
    Dim sNum, iNum, iMax
    '移動先の桁を取得
    sNum = InputBox("移動後の桁位置を指定してください." _
                    , "指定の桁へ移動")

    '数値以外ならキャンセル
    If Not IsNumeric(sNum) Then
        MsgBox "数値以外が入力されました."
        Exit Sub
    End If
    iNum = CLng(sNum)

    '行末桁より大きければ行末へ移動
'   Editor.GoLineEnd
    iMax = CLng(ExpandParameter("$x"))
'   If iNum >= iMax Then Exit Sub
    If iNum < iMax Then
        'カーソル位置が指定桁より小さくなるまで左移動
'       Editor.GoLineTop
        Do While CLng(ExpandParameter("$x")) > iNum
            Editor.Left
        Loop
    Else
        'カーソル位置が指定桁より大きくなるまで右移動
'       Editor.GoLineTop
        Do While CLng(ExpandParameter("$x")) < iNum
            Editor.Right
        Loop
    End If

End Sub
}}
----

#comment

    ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS