CUT

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

Deletes selected text from a text window or texteditor and copies it to Windows clipboard.

Syntax

  1. #handle "!cut"
  2. #handle.ext "!cut"

Hints

Using !cut. The cut command can be used to programatically delete or find/replace text. Cut (deleted) text is placed on the clipboard, but, of course, it does not have to be used or pasted from the clipboard. It can just be ignored.

Example

nomainwin

WindowWidth=300
WindowHeight=400

statictext #h.st1 "Enter text data", 10, 15, 200, 20
texteditor #h.text 10, 35, 260, 150
button #h.btn "Cut", [cutWord], UL, 10, 200
texteditor #h.text2 10, 230, 260, 90
    open "" for window as #h
    #h "trapclose [quit]"
    #h.text "Select a word or words from this text";chr$(13);_
            " and press the Cut button to paste the ";chr$(13);_
            " text into the lower text editor."
    wait

[cutWord]
    #h.text "!cut"
    #h.text2 "!paste"
    wait

[quit]
    close #h
    end

Useful Procedures

' Place a useful function using this keyword here