sysHasParaTags Script

Build 1501 on 14/Nov/2017  This topic last edited on: 9/May/2012, at 13:04

Description

Returns true if there are paragraph tags in the current paragraph.

Syntax

Dim bResult = sysHasParaTags

Code

Function sysHasParaTags()

  ' v1 returns true if there are para tags

   sysHasParaTags = False

  Dim bLeft As Boolean = False

  Dim bRight As Boolean = False

  Dim objCur = Text.GetCursor(modeSrcOn, cposCursor, False)

 

  ' find the previous end of para

  Dim objFrom = objCur.Duplicate

  Do

    Dim objDesc = objFrom.GetDesc

    If objDesc.GetType = tptPara Then

       objFrom.Move(1)

       bLeft = True

      Exit Do

    End If

  Loop While objFrom.Move(-1) = 0

   bLeft = True

  Dim objTo = objFrom.Duplicate

 

  ' find the beg of text

  Do

    Dim objDesc = objTo.GetDesc

    If objDesc.GetType = tptText Then

       bRight = True

      Exit Do

    End If

  Loop While objTo.Move(1) = 0

  If Not objFrom.IsEqual(objTo) Then sysHasParaTags = True

End Function

See also

HasTag, HasTagInPara, HasTagInString