getscrap
PROMPT

The getscrap statement will display a dialog with a text entry area. The entered text is placed in the clipboard.


Parameters

This statement has one parameter:

prompt – is a message that will be displayed in the dialog, just above the text. This message should explain what the user needs to enter.


Description

This statement will display a dialog with a text entry area. The user may enter something and press Ok, or they may press the Stop button. If they press Ok, whatever they typed will be placed on the clipboard, where it can be retrieved with the clipboard() function. If they press the Stop button the procedure will stop and the clipboard won’t be updated.

The dialog is usually just large enough to enter one line containing about 25 characters of text. To make this dialog larger use the customdialog statement. Or for full customization, use the newer gettextdialog statement instead of this statement.

This example asks the user to enter an area code, then enters that code into the AreaCode field. If the user presses Stop, the AreaCode field will not be modified.

getscrap "Area code:"
AreaCode=clipboard()

The problem with the getscrap statement is that it clobbers the clipboard, which you may be using for something else. So if you are writing new code, don’t use the getscrap statement – use the gettext statement instead. Here is a version of this code that has been rewritten so that it doesn’t clobber the clipboard.

gettext "Area code:",AreaCode

Historical Note: The word “scrap” is the original name for the Macintosh clipboard from the 1980’s, so the name of this statement came from “get scrap”, i.e. get a value into the scrap, i.e. clipboard. Over the years the word “scrap” has gone out of favor and this feature is now usually called the clipboard, but the original term lives on in the name of this statement.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0.