GLL Clipboard commands
Gfa_Cut
Gfa_Paste
Gfa_Copy
Gfa_CopyRtf
Gfa_CopyPre [head$, tail$, flag]
Gfa_Cut copies the selected text to the clipboard and deletes it from its original location.
Gfa_Paste inserts the clipboard contents at the current location.
Gfa_Copy copies the selected text to the clipboard.
Gfa_CopyRtf copies the selection in RTF format preserving syntax colouring, font, and indention. The contents of the clipboard can be pasted in a RTF compatible word processor.
Gfa_CopyPre [head$, tail$, flag] copies the source code in CF_TEXT format with HTML-coding to the clipboard. When a selection is available, the selection is copied, otherwise the entire source code text.
The optional parameter Head$ may contain HTML code that is inserted before the <pre> tag.
The optional parameter Tail$ may contain HTML code that is appended to the closing <\pre> tag. (For instance, "</BODY></HTML>", when the source code is added at the end of a HTML page).
The optional integer flag% species whether to include the procedure separation line which is used in the editor to visually separate procedures. When flag = 1 adds </pre><hr><pre> (a HTML-dividing line). When flag = 0 there will be no dividing line.
Sub Gfa_App_P
Gfa_CopyPre
EndSub
When this piece of code is selected and copied to the clipboard it is placed between <pre> tags and font tags are inserted. GFA-BASIC 32 puts the following string on the clipboard:
"<pre>Sub <Font Color=800000>Gfa_App_P" #13#10 _
" </Font>Gfa_CopyPre" + #13#10 _
"EndSub" #13#10 "</pre>"
The string starts with the <pre> tag followed by the Sub keyword. Since the procedure name is colored in red, the <Font Color=800000> tag is inserted. The font coloring is disabled after the CRLF and the rest of the code is colored in the default color. The snippet is ended with the <\pre> tag.
Sub Gfa_App_P
Dim head$ = "<HTML><HEAD><META HTTP-EQUIV" _
"=""Content-Type"" content=""text/html;" _
" charset=iso-8859-1"">" #13#10 _
"<TITLE>" & App.Name & "</TITLE></HEAD><BODY>"#13#10 _
"<H1 align=Center>//" & App.Name & "</h1><hr>"
Dim tail$ = "</BODY></HTML>"#13#10
Gfa_CopyPre head$, tail$, 1
End Sub
To save the entire source code use Gfa_SaveFile.
Gfa_SelCol, Gfa_SelLine, Gfa_SelectAll, Gfa_IsSelection, Gfa_SavePreFile
{Created by Sjouke Hamstra; Last updated: 07/10/2014 by James Gaite}