clipCopies or cuts content of a field to the clipboard or pastes from the clipboard to a field. Syntaxvoid clip() Description clip() copies or cuts the entire display value from the active field to the clipboard or pastes the clipboard to the active field. This feature is particularly useful when copying or cutting long strings such as SMILES. You can also use the Windows clipboard utility. ExampleThe copy, cut, and paste utilities might be included as menu items under Edit on the menu bar. Set G.key in the menu item triggers as shown in the example below and execute clip() in the window trigger.
Copy Menu Item Trigger:
{
G.key= key_38; /* copy field display to clipboard */
escape(input);
}
Cut Menu Item Trigger:
{
G.key= key_39; /* copy field display to clipboard then clear field */
escape(input);
}
Paste Menu Item Trigger:
{
G.key= key_40; /* paste from clipboard to field display */
escape(input);
}
The copy, cut and paste actions are executed in the window trigger:
...
if (G.key in (key_38,key_39,key_40)){
clip();
if (G.key == key_40){
move_f2l(0);
g.modified= true;
}
...
Updated 19 May 1999. Copyright DataAspects Corp. 1998-1999 |