次の方法で共有


EditPoint.GetLines メソッド

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

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

構文

'宣言
Function GetLines ( _
    Start As Integer, _
    ExclusiveEnd As Integer _
) As String
string GetLines(
    int Start,
    int ExclusiveEnd
)
String^ GetLines(
    [InAttribute] int Start, 
    [InAttribute] int ExclusiveEnd
)
abstract GetLines : 
        Start:int * 
        ExclusiveEnd:int -> string 
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

.NET Framework セキュリティ

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

参照

参照

EditPoint インターフェイス

EnvDTE 名前空間