Loading ...
Sorry, an error occurred while loading the content.

19677Re: [NTB] "Cannot open clipboard" error in NoteTab Light

Expand Messages
  • Sheri
    Apr 3, 2007
      lasoh wrote:
      >
      > I was running script below to format some text. I got a pop-up
      > saying "Cannot open clipboard". What does this error mean & how to
      > fix? Any helpful suggestions?
      > ============ ========= ========= ========= ========= =========
      > ========= ===
      >
      Hi,

      I would suggest you put everything into a variable and update the
      clipboard only once. You probably have a timing issue, trying to
      simultaneously read the clipboard and rewrite the clipboard.

      ^!Set %myfields% ^%Empty%
      etc.
      ^!Set %myfields%=^%myfields% ^$GetField( 1)$^%TAB%
      etc.
      :End Loop
      ^!SetClipboard ^%myfields%
      ^!Set %myfields%=^%Empty%

      You could also bypass the clipboard entirely. Instead of ^!SetClipboard, do

      ^!InsertText ^%myfields%

      Regards,
      Sheri


      > ;Empty the content of the Clipboard
      > ^!SetClipboard ^%Empty%
      >
      > ;Copies the line count number to a variable
      > ^!Set %MaxRow%=^$GetLineCount$
      >
      > ;Initialize variable Row to 0
      > ^!Set %Row%=0
      >
      > ;Prompt user for field delimiter used in document (the sample file
      > Data.txt uses tabs)
      > ^!SetDelimiter ^t
      >
      > :LoopStart
      >
      > ;End loop if value contained in Row is greater than the value
      > contained in MaxRow (i.e. Number of lines in document)
      > ^!Inc %Row%
      > ^!If ^%Row% > ^%MaxRow% EndLoop
      >
      > ;Place cursor at beginning of line
      > ^!SetCursor ^%Row%:1
      >
      > ;Skip this line?
      > ^!If ^$GetField(14) $ = 11 LblMapRule
      > ^!If ^$GetField(14) $ = 91 LblMapRule
      > ^!If ^$GetField(14) $ = 111 LblMapRec
      > ^!If ^$GetField(14) $ = 191 LblMapRec
      > ^!Goto LoopStart
      >
      > :LblMapRule
      >
      > ;Add following list of fields to the Clipboard
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 1)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 2)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 4)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 5)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 6)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 7)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 8)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 9)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 11)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 15)$^%NL%
      >
      > ^!GoTo LoopStart
      >
      > :LblMapRec
      >
      > ;Add following list of fields to the Clipboard
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 1)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 2)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 3)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 4)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 5)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 6)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 7)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 8)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 9)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 10)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 11)$^%TAB%
      > ^!SetClipboard ^$GetClipboard$ ^$GetField( 15)$^%NL%
      >
      > ^!GoTo LoopStart
      >
      > :EndLoop
      > ;Paste contents of the Clipboard into itself
      > ^!Select ALL
      > ^!Paste
      >
      >
    • Show all 4 messages in this topic