pasteClipBoardInto command completely overwrites the existing member

From:         Tom Higgins <>
Subject:      Re: Fields losing their identity on pasteClipboardInto member

The fact that the pasteClipBoardInto command completely overwrites the
existing member is by design. This is so that you can paste any data from
the clipboard into any member and have a new appropriate member type. Thus,
you can copy some image data to the clipboard, then paste that image data
into a field cast member slot, the existing field member is removed and is
replaced with a new bitmap cast member. When pasting text from the clip
board, a new member is created and all new text/field members default to
being non-editable and they are unnamed. All of this information is
mentioned in the Lingo Dictionary definition for pasteClipBoardInto.

Definitely use a dummy cast member to paste your clipboard contents into,
then move the text from the dummy member into your member used for display.
If you want to be certain that you've pasted text contents into the member
(and not graphics data for example), then check the dummy member's type
after the paste operation to verify that you have a field member. Here is
my example code:

-- before getting here I created a dummy member in my cast and named
-- it "paste target"

on pasteOperation

  -- store reference to member as it's about to lose its name
  targetMember = member("paste target")

  -- perform paste operation

  -- check the type of the target member to verify text pasting
  if (targetMember.type <> #field) then
    -- respond however you wish to non-text data having been pasted
  end if

  -- move your pasted contents into your display member
  member("display member").text = targetMember.text

  -- rename the target member for the next paste operation = "paste target"

end pasteOperation


Home shock + cgi Bits 'n pieces Director Lingo ShockLets Contact