1 Reply Latest reply on Jun 17, 2007 7:43 AM by Newsgroup_User

    delete member char problem

    Level 7
      hello everyone
      I use the following code to split a large rtf file into several cast
      members during authoring.
      The code can split the text I want. But the problem is that in each of the
      new text cast members, I find that the first character is missing.

      on makePages me, textMem, mheight, mWidth
      member(textMem).height = mheight
      member(textMem).width = mWidth

      mCastLibNum = member(textMem).castLibNum
      charCount = member(textMem).char.count
      wrapLines = locVToLinePos(member textMem, mheight)
      whereToCut = locToCharPos(member textMem, point(mWidth,mheight))

      -----------SET NAMES FOR PAGES
      fEmpt = castLib(mCastLibNum).findEmpty()
      newMem = member(fEmpt)
      newMemNum = newMem.number

      -- make a duplicate
      member(textMem).duplicate(fEmpt)

      -- rename the duplicate member
      newMemName = newMem.name
      newMemName = newMemName & newMemNum
      member(newMem).name = newMemName

      --take duplicate member, select wanted text and delete the rest
      delete member(newMemName).char[whereToCut..charCount]
      delete member(textMem).char[1..whereToCut]

      end

      any help to solve this will be appreciated.
      thanx
      ahmed