"CLIP: " Clipboard Contents Not Available Across MultiFinder (35712)






This article was previously published under Q35712

SUMMARY

When you OPEN and write to the "CLIP:" device in a QuickBASIC program, the contents of the clipboard may not be carried over when you switch to another application under Apple MultiFinder.

To ensure that the contents of the clipboard are available across a context switch in MultiFinder, you need to call the ROM trap SystemEdit with the appropriate argument after every Edit operation (including Undo, Cut, Copy, Paste, Clear, or output to the "CLIP:" device name):
   Operation   Argument

   Undo        0
   Cut         2
   Copy        3
   Paste       4
   Clear       5
				

MORE INFORMATION

The program below calls the SystemEdit ROM trap after copying a sentence into the clipboard. This ensures that the contents of the clipboard are available to other applications when you switch to them under MultiFinder.

The program is as follows:
    ToolBox "i"         'initialize ToolBox
    SystemEdit% = &H9C2    'SystemEdit trap word
    b% = 0    'SystemEdit returns a boolean (b%) that's useless to a
              'BASIC program but a dummy value needs to be passed
    OPEN "clip:" FOR OUTPUT AS #1
    PRINT #1, "This goes in the clipboard"
    CLOSE #1
    ToolBox "BQ", SystemEdit%, 3, b%
    IF OSerr& THEN
       BEEP
       PRINT "Couldn't Update System Clipboard"
    ELSE
       PRINT "System Clipboard updated."
       PRINT "You may now switch applications in MultiFinder."
    END IF
				
The need to call the SystemEdit ROM trap for applications (such as QuickBASIC) that do not accept suspend/resume events from MultiFinder is documented in "Macintosh Technical Note #180: MultiFinder Miscellanea." This Note is available from Apple Computer.

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB35712