BB___PASTE

=PASTE= toc

Description
> Places any text on the Windows clipboard at the current cursor position in a text window or texteditor.

Syntax

Hints

 * //**Using !paste.**// Text copied to the clipboard is available to be used again and again until it is replaced with different content. You can use paste (and copy) to programatically provide a find/replace procedure in your program.

Example
code format="lb" nomainwin

WindowWidth=300 WindowHeight=300

statictext #h.st1 "Enter contact data", 10, 15, 200, 20 texteditor #h.text 10, 35, 260, 150 button #h.btn "Close", [mainExit], UL, 10, 200

open "" for window as #h #h "trapclose [quit]" '   'print some sample text to the texteditor window '   #h.text "This is the original contents of the data file. ";chr$(13);_ "Close window without changing text.";chr$(13);_ "Then change text and close window to see ";chr$(13);_ "the difference." wait

[mainExit] 'check if text has changed...   #h.text, "!modified? modify$"

If modify$ = "true" then #h.text "!selectall"       'select text #h.text "!copy"            'copy it to clipboard

'       'open a window to paste text into '       open "Copy window" for text as #c #c "!trapclose [quitC]" #c "!paste" else goto [quit]                'if modify$ = "false", end program... End if

wait

[quitC] close #c                       'close the paste window wait

[quit]                             'close main window close #h end code

Useful Functions
code format="lb" Place a useful function using this keyword here code