EditPoint.GetLines メソッド

更新 : 2007 年 11 月

指定した 2 行の間にあるテキストを表す文字列を取得します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
Function GetLines ( _
    Start As Integer, _
    ExclusiveEnd As Integer _
) As String
'使用
Dim instance As EditPoint
Dim Start As Integer
Dim ExclusiveEnd As Integer
Dim returnValue As String

returnValue = instance.GetLines(Start, _
    ExclusiveEnd)
string GetLines(
    int Start,
    int ExclusiveEnd
)
String^ GetLines(
    [InAttribute] int Start, 
    [InAttribute] int ExclusiveEnd
)
function GetLines(
    Start : int, 
    ExclusiveEnd : int
) : String

パラメータ

  • Start
    型 : System.Int32

    省略可能です。指定のテキストに含める最後の行の番号。

  • ExclusiveEnd
    型 : System.Int32

    必ず指定します。指定のテキストに含める最初の行の番号。

戻り値

型 : System.String

指定した 2 行の間にあるテキスト。

解説

返される文字列は、Start 以上で ExclusiveEnd 未満の範囲にあるテキストを表します。文字列には、行の境界を表す改行文字 (ACSII 文字 13) が含まれます。 最終行が改行文字で終わる場合は、改行文字で終了します。

Sub GetLinesExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")
        
   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
        
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
   objEditPt.StartOfDocument()
   msgbox("The results of GetLines: " & Chr(13) & objeditpt.GetLines(1, 6))
End Sub

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

EditPoint インターフェイス

EditPoint メンバ

EnvDTE 名前空間