For future reference, here's my slightly ridiculous workaround to my slow StyleRunCount problem. It's only slightly slower on Mac and light years faster on PC -- plus, it offers the comical effect of watching the selection cursor zoom around on the page. It kinda reminds me of the Commodore 64.

ian
----------------------

  InputText = me.StyledText

  isCite = FALSE
  isStrong = FALSE
  isEm = FALSE

  runCount = Len(me.Text) // -1?

  finalText = ""

  for i = 0 to runCount

    me.SelStart = i
    me.SelLength = 1

    if me.SelBold <> isStrong then
      if not isStrong then
        finalText = finalText + "<strong>"
        isStrong = TRUE
      else
        finalText = finalText + "</strong>"
        isStrong = FALSE
      end if
    end if

    if me.SelItalic <> isCite then
      if not isCite then
        finalText = finalText + "<cite>"
        isCite = TRUE
      else
        finalText = finalText + "</cite>"
        isCite = FALSE
      end if
    end if

    if me.SelUnderline <> isEm then
      if not isEm then
        finalText = finalText + "<em>"
        isEm = TRUE
      else
        finalText = finalText + "</em>"
        isEm = FALSE
      end if
    end if

    finalText = finalText + me.SelText

  next i
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to