Description
- Selects everything in a text window or text-editor (highlights it).
Syntax
- #handle "!selectall"
- #handle.ext "!selectall"
Hints
- Using !selectall. To quickly remove the contents from the text window, issue this command and then immediately print a #handle.ext ""; to the window.
Example
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
Useful Procedures
' Place a useful function or sub using this keyword here