home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
tse2jr4.zip
/
QTIPS.DOC
< prev
next >
Wrap
Text File
|
1997-02-21
|
63KB
|
1,341 lines
A compilation of The SemWare Editor Junior Tips
from the SemWare Technical Support Staff
Alternate Cut, Copy, and Paste macros with ability to append
──────────────────────────────────────────────────────────────────────────────
The current behavior of these commands is as follows:
Cut - place marked text into Scrap Buffer, delete it from the file
Copy - place marked text into Scrap Buffer, block will be unmarked only
Paste - insert the contents of the Scrap Buffer at current cursor
position
The following macros give these commands a new behavior:
Cut - "append" marked text to Scrap Buffer, delete it from the file
Copy - "append" marked text to Scrap Buffer, unmark block
Paste - insert the contents of the Scrap Buffer at current cursor
position
Empty - clear the contents of the Scrap Buffer
Initially the Scrap Buffer is empty, but as text is Cut or Copied, it
gets appended to the Scrap Buffer. Each Cut or Copy will continue to
append the text to the Scrap Buffer. Use the Empty macro to clear the
Scrap Buffer contents.
If no block is marked, the Cut and Copy macros will use the current
cursor line, and move the cursor to the next line. This allows you to
easily cut or copy a series of lines by repeatedly pressing the Cut or
Copy macro key.
The contents of the Scrap Buffer are not emptied when the Paste macro is
used. This allows the text to be pasted multiple times.
*
* Paste
*
grey* SetScreenOff * turn OFF screen updating
GetScrBuff * paste text from scratch buff
"_MY_CLIP_" Return * specify our scratch buff
UnMarkBlock * remove this line to leave block marked
*
* Empty
*
^del DelScrBuff * delete contents of scratch buff
"_MY_CLIP_" Return * specify our scratch buff
*
* Copy
*
grey+ SetScreenOff * turn OFF screen updating
AppendScrBuff * attempt to append to scratch buff
Jump mark * if AppendScrBuff fails, jump to mark
"_MY_CLIP_" Return * else tell it which scratch buff to us
UnMarkBlock * unmark the block
MacroQuit * and quit
mark: UnMarkBlock * make sure there is no block marked
MarkLine * mark the current line
AppendScrBuff * append to scratch buff
MacroQuitFalse * quit if failed
"_MY_CLIP_" Return * specify our scratch buff
UnMarkBlock * unmark the block
CursorDown * and cursor down to next line
*
* Cut
*
grey- SetScreenOff * turn OFF screen updating
AppendScrBuff * attempt to append to scratch buff
Jump mark * if AppendScrBuff fails, jump to mark
"_MY_CLIP_" Return * else tell it which scratch buff to us
DeleteBlock * delete the block
MacroQuit * and quit
mark: UnMarkBlock * make sure there is no block marked
MarkLine * mark the current line
AppendScrBuff * append to scratch buff
MacroQuitFalse * quit if failed
"_MY_CLIP_" Return * specify our scratch buff
DeleteBlock * delete block, cursor now on next line
Macros and Prompt Boxes - special tricks
──────────────────────────────────────────────────────────────────────────────
In many cases, it would be ideal for macros to know if they have been
interrupted by a Menu or Prompt - otherwise, the typical result is that
the rest of the macro is gobbled up by the Prompt, looking for a valid
command to execute.
There just so happens to exist a little know feature that allows you to
determine if a Prompt is active. You do this by taking advantage of the
Jump or MacroQuit commands.
The logic goes like this: The MacroQuit and Jump commands are not
operational inside a Prompt, so, if the command is not successful, a
Prompt must currently be active.
For example, suppose you want a WriteBlockAndAppendIfExists command.
@w WriteBlock Pause Return
MacroQuit * if the macro is finished, stop now
* otherwise (MacroQuit ignored) we must be in a prompt
'A' * force appending of the file
Similar logic, using the Jump command:
@w WriteBlock Pause Return
Jump end * if the macro is finished, stop now
* otherwise (Jump ignored) we must be in a prompt
'A' * force appending of the file
end:
Using Copy and Paste in Prompts
─────────────────────────────────────────────────────────────────────────────
In The SemWare Editor Junior you can answer a prompt by using the copy and
paste commands. This technique is really useful for loading files and
searching for words in the current document.
For example, a macro to look for the next occurrence of the current word
at the cursor could be done like this:
* Macro for TSE Jr.: Find next occurrence of current word.
@= MarkWord * Mark current word.
MacroQuitFalse * If no word to mark, quit macro.
Copy * Copy marked text to scrap.
Find * Call find command, displays prompt.
Paste * Paste scrap into Find prompt.
Return * Accept the entry in the prompt.
Return * Accept the current search options.
This can also be used for editing a file. You can mark the name of the
file that you want to edit in a file, the select EditFile (<Alt E>), and
copy the name into the prompt and then press <Enter>.
The InsertDate Command in TSE Jr. 2.15
─────────────────────────────────────────────────────────────────────────────
In TSE Jr. versions 2.15 and earlier, when you used the InsertDate command,
the output contained the full year:
Tue 11-02-1993
However, in The SemWare Editor Junior, output of InsertDate does not
contain the first part of the year:
Tue 11-02-93
To insert the "19" part of the year, use the following macro:
<KEY> SaveSettings * Save Settings of Insert, WordWrap, etc.
SetScreenOff * Turn OFF screen updates
InsertDate * Insert the Date
SetInsMode * Set Insert ON
CursorLeft 2 * Move Back to the beginning of the year
"19" * Insert the 19 part of the year
CursorRight 2 * Move to the end of the year
RestoreSettings * Restore our original condition
This macro can be bound to any available key in your QCONFIG.DAT file.
Converting TSE Jr. 2.x and 3.0 macros to The SemWare Editor Junior 4.0
─────────────────────────────────────────────────────────────────────────────
The binary macro files compiled with QMAC from TSE Jr. 3.0 and earlier are
not completely compatible with The SemWare Editor Junior 4.0. However,
there is a painless process to convert your macros.
To follow this process you will need to determine if you have text file
versions of your macros. If you do not, you will need to follow this
process:
(1) Copy all of your binary macro files (*.MAC) to a temporary directory.
(2) Copy the QMAC program (QMAC.EXE) from your TSE Jr. 2.x/3.0 directory to
your temporary directory.
(3) For each of the *.MAC files, run QMAC to convert them to text files.
For example:
C:\QETMP>QMAC <FileName>.MAC <FileName>.Q /A- /T
Where <FileName> is the file to convert.
This process creates the text file versions of your macros. The files
will have the same name as the original macros, but with a ".Q" extension.
This process is for everyone. It will convert your TSE Jr. 2.x/3.0 macros
into TSE Jr. 4.0 macros:
(1) Copy all of text macro files (for those who followed the first
process: the *.Q files in the temporary directory) to your TSE Jr. 4.0
directory.
(2) For each of the text macro files, run the new QMAC program to convert
them to binary files. For example:
C:\QE3>QMAC <FileName>.MAC <FileName>.Q /A- /B
That is it! You have now successfully re-compiled your macros.
Multi-Line Macro Format
─────────────────────────────────────────────────────────────────────────────
Since TSE Jr. 3.0, you can have multi-line macros in your QCONFIG.DAT file.
This capability gives you much more power over previous versions. If you
are upgrading from TSE Jr. 3.0, you may skip this section.
When upgrading from TSE Jr. 2.15 (or earlier) there are a couple of
conventions that must be followed when formatting your QCONFIG.DAT file:
(1) The key must appear in the first column of the command assignment or
macro.
(2) When writing macros, all succeeding lines must be indented one or more
columns.
The reason for these conventions is to differentiate between commands and
keys. Consider this example, which does NOT follow the new conventions:
* This comment starts in column one.
*
CursorDown CursorDown BegLine
CursorUp CursorUp BegLine
Before TSE Jr. 3.0, the first word on each line would have been interpreted
as a key automatically. However, with multi-line macros it is no longer
clear exactly what the user intended here. These lines could be seen as
either two individual key assignments, or as a single macro. (Granted, it
would be a silly macro -- one step forward and two steps back!)
Here is an example of a few key assignments that follow the new format:
* This comment starts in column one.
*
^k_h BegLine * Fancy Home Macro
isCurrChar ' ' MacroQuitFalse
FirstNonWhite
CursorDown CursorDown * Down / BegLine
BegLine
CursorUp CursorUp BegLine * Up / BegLine
Startup Macros
─────────────────────────────────────────────────────────────────────────────
The SemWare Editor Junior has the capability of loading and/or executing
your compiled macro files on startup through the use of command line
parameters. The macro files being used must be in binary format created
using the MacroWrite command <Esc><M><W> command or QMAC.
To LOAD a macro from the command line enter "-l" or "/l" (a dash or slash
and the letter "l") followed immediately by a macro filename. The maximum
size of a loadable macro file is 2k. The format for loading a macro
follows:
q <filename to edit> -l<macro filename>
To EXECUTE a macro from the command line enter "-e" or "/e" followed
immediately by a macro filename. The maximum size of an executed macro is
500 bytes. The format for executing a macro on startup follows:
q <filename to edit> -e<macro filename>
When using the execute ("-e or /e") option, the first macro in the
macrofile is executed. The macro is then executed only after the file to
be edited has been loaded. The macro file is executed once and not loaded
into the editor.
A filename must be supplied to make use of the command line parameters.
Both the load and execute macro parameters may be used at the same time.
The order that they are specified on the command line is not important.
The format for executing a macro and loading a macrofile on startup
follows:
q <edit filename> -e<macro filename> -l<macro filename>
To illustrate the above, suppose you want to edit a file called WORK.TMP
and at the same time, from the command line, load the macro file called
FIRST.MAC and execute the macro file called SECOND.MAC. From the command
line you would enter:
q work.tmp -lfirst.mac -esecond.mac
QMac: The Basics
─────────────────────────────────────────────────────────────────────────────
QMac is a translator of The SemWare Editor Junior macro files. It
translates macros from the binary file, to a text file which allows easy
macro editing, and translates such text files back into a binary file.
This allows you to "record" a macro using the editor; fine-tune it by
editing the text representation of the macro; and then translate the
edited version and reload it into the editor for replay.
QMac allows appending to or overwriting existing files, making it easy to
add new macros to existing files. QMac's text file format allows comments,
permitting documentation of the macros within their "source file".
To see a summary of QMac's operations, type "QMAC ?" at the DOS prompt and
press <Enter>. All of the command-line switches are optional and are only
necessary to control QMac's operation in special ways.
Here is a quick run-through of what you can do with QMac, including
recording a macro, saving it to disk, and converting it with QMac. The
keystrokes mentioned below assume you are using the default QCONFIG.DAT
supplied with The SemWare Editor Junior; if you have re-installed your
keyboard using QCONFIG, please modify as needed.
Recording a Macro:
~~~~~~~~~~~~~~~~~
1. From inside the editor, select MacroRecord. (Either hit <Ctrl M> or
select "Macro Record" from the "Macro" menu in the pull-down menu system,
by pressing <Esc><M><M>).
2. At the prompt that says "Assign to what key:" press a key to redefine.
We will use <Ctrl F10>
3. Execute Find <Ctrl QF>, type "the" and press <Enter>, and type "IW" and
press <Enter> again. (This is just an example of what you can do. You
could of course record any legal series of editor keystrokes here.)
4. Select MacroRecord again to end the macro, like step 1 above.
5. Now, you can press <Ctrl F10> to search for the word "the" in your text
in just one step.
Saving the Macro:
~~~~~~~~~~~~~~~~
6. Let's write this macro to disk in a file that QMac can use. Select
MacroWrite from the pull-down menus, by pressing <Esc> then <M><W>.
7. Give it a filename of "FIND.MAC", and press <Enter> to save this macro
on disk.
Converting the Macro to Text:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8. Execute Dos <Alt F9> to send a command to MS-DOS. Type:
QMAC FIND.MAC FIND.TXT /A- /T
to convert FIND.MAC to a text form in the file FIND.TXT. Press <Enter>.
(The /T selects text output).
9. Execute EditFile <Alt E> to load this file into the editor. Type
"FIND.TXT" to load the text file you just created with QMac. Press
<Enter>. You should see something like this on the screen:
* * Converted by QMAC from: C:\FIND.MAC *
^f10 MacroBegin Find "the" Return "IW" Return
Which is, of course, a text representation of the keystrokes you just
recorded.
10. You can now edit your macro if necessary. Let's change the word "the"
to "and", and save the file back to disk by executing File <Ctrl KX>.
Converting the Macro from Text back to Binary:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11. Execute Dos <Alt F9> to send a another command to MS-DOS. This time,
type:
QMAC FIND.MAC FIND.TXT /A- /B
to convert FIND.TXT back to its BINARY form, FIND.MAC. (NOTE that we use
/B to tell QMac to make the binary file from the text file we just
edited.) Press <Enter>.
QMac Additional Notes:
~~~~~~~~~~~~~~~~~~~~~
QMac will create whichever of the two files (binary or text) that did not
exist already. If the text macros already exist, it will convert them to
binary. Or if the binary macros already exist, it will convert them to
text.
However, if both files exist, you must supply one of the optional switches
to determine the direction. The switch /B tells QMac to create a Binary
file, while /T tells it to create a text file.
If the output file already exists, you must also supply a /A+ or /A-
switch to tell QMac whether to "append" to the existing file. With /A+ it
will append, /A- tells QMac to overwrite the existing file.
Anywhere an asterisk ("*") appears on a line, outside of a quoted string,
the rest of the line is treated as a "comment" and is ignored by QMac.
You can use this to include notes to yourself about how your macros work,
or what they are supposed to do. Comments are not included in the binary
macro file that the editor loads, so there is no penalty for including
them in your text macro files.
A macro can continue onto more than one line. Simply indent the second and
subsequent lines of the macro one or more spaces. The macro continues
until QMac runs out of text or encounters another key at the beginning of
a subsequent line.
The SemWare Editor Junior in 28-line or 43/50-line Mode on Startup
─────────────────────────────────────────────────────────────────────────────
If you want to have the editor start up in 28-line or 43/50-line mode, you
can select the "Startup video mode" option under Colors/Screen in the
QCONFIG program. Using this option, you can force the editor to come up in
28-line or 43/50-line mode.
Saving Files and Exiting
─────────────────────────────────────────────────────────────────────────────
The editor provides several different ways to save files, discard files,
and exit the editor. A set of five basic commands provides various
combinations of saving, discarding, and exiting in order to suit
individual preferences.
We recommend selecting one or two methods with which you feel most
comfortable and use them consistently. Below is a description of the
basic commands for both single and multiple files along with our default
key combinations.
1) SaveFile <Ctrl K><S> - save the currently edited file to disk. The
file remains loaded into the editor for further editing.
GSave <Alt Y> - Like the SaveFile command, but it issues the SaveFile
command for all the files that have been modified.
2) File <Ctrl K><X> - Unconditionally saves and then discards the current
file. It then either goes to the next file in the editor file
ring or the "File(s) to edit" prompt.
GFile <Alt F><G> - Like the File command, but it instructs the editor
to save all files that have been modified and then discards all
the files that are loaded and exits.
3) Exit <Ctrl K><D> - Conditionally discards the currently edited file.
If the file has not been modified, the file is discarded without
prompting and the editor is exited. If the file has been
modified, the editor will prompt "Save Changes (Y/N)?" Selecting
<Y> will save and discard the file, then exit. Selecting <N> will
discard the file without saving any changes and exit.
GExit <Alt X> - Like the Exit command, but it issues the Exit command
for all loaded files. If no files have been modified, it will
immediately exit the editor. If any files have been modified, the
"Save Changes (Y/N)?" prompt will be displayed for each modified
file.
4) PQuit <Ctrl K><Q> - A protected quit that will warn the user of a
modified file before discarding the file. If the file has not
been modified, it is discarded without prompting. If the file has
been modified, the editor will prompt "Lose Changes (Y/N)?"
Selecting <Y> will discard the current file without saving changes
and then either go to the next file in the editor file ring or the
"File(s) to Edit" prompt. Selecting <N> will return you to the
file to resume editing.
GPQuit <F3> - Like the PQuit command but it issues the PQuit command
for all loaded files. If no files have been modified, it will
immediately exit the editor. If any files have been modified, the
"Lose Changes (Y/N)?" prompt will be displayed for each modified
file and then the editor is exited.
5) Quit - An unconditional quit. The current file is discarded
regardless of any changes made to it. NOTE: Use this command with
caution! The Quit command is not assigned to a default keystroke.
The Exit, File, PQuit commands can be configured to terminate or not
terminate the editor and ask for another file to edit. This option can be
customized using the configuration program QCONFIG.EXE. Run QCONFIG.EXE,
select G)eneral Options, and return till you get to the option that reads:
Do you want the PQuit, Exit and File commands to return to "EditFile"
prompt (Y/N)? [Y]
The default configuration is set to <Y> and will return you to the
EditFile prompt upon executing the PQuit, Exit, and File commands or go to
the next file in the editor file ring. If set to <N>, it will terminate
the editor upon executing the above commands. The SaveFile and Quit
commands are not affected by this setting.
A Few Recommendations:
~~~~~~~~~~~~~~~~~~~~~
* If you know what you are doing and want to get in and out of the editor
quickly, use the GFile command.
* If you want to make one more final check before you exit the editor,
use the GExit.
* PQuit/GPQuit and Exit/GExit are not intended to be used at the same
time, but to give the user opposing approaches to saving files and
exiting the editor.
Types of Block Marking and Unmarking
─────────────────────────────────────────────────────────────────────────────
A block is a portion of a text file which has been defined by using the
editor's Block marking commands. The editor has a rich set of Block
commands. These commands mark Blocks by lines, columns, and characters.
To define a block, you must first "mark" or outline a Block. There are
four Block types available: line, column, inclusive character blocks, and
non-inclusive character blocks. The one you choose will depend on the
editing situation and what you feel most comfortable using. Below is a
description of the commands along with our default key combinations.
MarkLine <Alt L> - will mark only complete lines and no portions of lines.
To use this command, place the cursor anywhere on the first line of
the text you want to mark and press <Alt L>. Now move the cursor to
the last line of text you wish to be marked and press <Alt L> again.
DropAnchor <Alt A> - will mark a Block one character at a time. The Block
will contain a stream of characters and can span over multiple lines.
To use this command, place the cursor over the first character of text
you wish to mark and press <Alt A>. Now move the cursor toward the
end of text to be marked. (Notice that the Block "follows" the cursor
position.) Once the cursor is placed over the last character to be
marked, press <Alt A> again.
MarkCharacter - will work just like DropAnchor except that while the Block
is being marked, the cursor is NOT included within the Block.
MarkCharacter is not assigned to a default keystroke.
MarkColumn <Alt K> - will mark one or more columns of text. To use this
command, place the cursor over the upper left-hand character of the
text you wish to mark and press <Alt K>. Now move the cursor to the
right and/or downward toward the end of text to be marked. (Notice
that the Block "follows" the cursor position.) Once the cursor is
placed over the lower right-hand character of the Block, press <Alt K>
again.
MarkBlockBegin <Ctrl K><B> and MarkBlockEnd <Ctrl K><K> - will mark one
character at a time. These commands do NOT show the block until
MarkBlockEnd is executed. To use this command, place the cursor over
the first character of the text you wish to mark and press <Ctrl
K><B>. Now position the cursor one character past the end of the text
that is to be marked and press <Ctrl K><K>.
MarkWord <Ctrl K><T> - will mark a single word. To use this command,
place the cursor at the first character of the word you wish to mark
and press <Ctrl K><T>. (If no word is at the current cursor position,
then no action is taken.)
UnMarkBlock <Alt U> - will cause the currently marked Block to be
unmarked.
A few side notes:
~~~~~~~~~~~~~~~~
* The editor allows you to mark only one Block at a time.
* If you mix Block types, the editor will mark the Block according to the
last command entered.
* MarkCharacter is provided as a replacement for the DropAnchor command.
If you want the cursor position included in the character Blocks, then
continue to use DropAnchor; otherwise, replace the DropAnchor command
with MarkCharacter in the QCONFIG.DAT file.
* When using MarkLine, MarkCharacter, MarkColumn, and DropAnchor
commands, it is not necessary to mark the end of the Block. The editor
will assume the end of the Block to be the current cursor position
and/or line depending on the command being used. Marking the end of
the Block is only necessary when moving or copying text within the same
file.
Manipulating Marked Blocks (Part A)
─────────────────────────────────────────────────────────────────────────────
The editor provides several ways to manipulate a marked Block.
Manipulation can be done directly, using the Scrap Buffer (ClipBoard), or
using the Scratch Buffers. Following is a description of each of the
editor's block manipulation commands along with our default key
combinations.
Manipulating Directly
~~~~~~~~~~~~~~~~~~~~~
The following commands allow you to manipulate a marked Block directly.
CopyBlock <Alt C> - will make a copy of the marked Block and insert it
where you decide. This can be either in another place in the same
file, or in another file. To use this command, mark the Block and
move the cursor to the position where you wish to insert the marked
text. Now press <Alt C> and notice the Block will be inserted at the
new position. To unmark the copied Block, enter the UnmarkBlock
command.
CopyOverBlock <Alt Z> - will work just like the CopyBlock command except
the Block is copied to the current cursor position by overlaying the
existing text. The command can ONLY be used with column Blocks. The
Block will be inserted without shifting the text to the right.
MoveBlock <Alt M> - will work just like the CopyBlock command except that
upon entering the MoveBlock command, the original marked Block is
deleted from the file.
DeleteBlock <Alt G> - will delete a marked Block of text from the file.
To use this command, mark the Block of text to be deleted, then enter
the DeleteBlock command.
ShiftLeft <Shift F7> and ShiftRight <Shift F8> - will shift the text
contained in a marked Block one column to the left or right. To use
these commands, mark the Block and enter the ShiftLeft or ShiftRight
command. If there is not a marked Block or the cursor is outside of
the Block, the current cursor line will be shifted.
Manipulating Using the Scrap Buffer (Clipboard)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Scrap Buffer is a temporary holding area for marked Blocks of text.
The commands Cut, Copy, Paste, and PasteOver are solely responsible for
manipulating text to and from the Scrap Buffer.
Cut <grey -> - will copy the marked Block into the Scrap Buffer. The Block
is then deleted from the file being edited. If no Block is marked,
the cursor line is cut into the Scrap Buffer.
Copy <grey +> - will copy the marked Block into the Scrap Buffer and then
unmark the Block. If no Block is marked, the cursor line is copied
into the Scrap Buffer.
Paste <grey *> - will insert the contents of the Scrap Buffer to the
current cursor position. If the Scrap Buffer contains a character or
column Block, it is inserted at the cursor position. If the Scrap
Buffer contains a line Block, it is inserted before or after the
cursor line depending on the configuration setting.
PasteOver <Ctrl PrtSc> - will work like the Paste command, but for column
Blocks. It takes a column Block which has been loaded into the Scrap
Buffer using the Cut or Copy commands and places it at the current
cursor position by overlaying the existing text and without shifting
text to the right.
When you issue a Copy or Cut command, the marked Block is placed in the
Scrap Buffer. The next time you Copy or Cut a Block into the Scrap
Buffer, the previous contents of the Scrap Buffer are deleted and replaced
with the new Block.
You can use the Paste and PasteOver commands as many times as needed to
insert a copy of the Block held in the Scrap Buffer at multiple positions
in your file or files. The Paste and PasteOver commands will not purge
the contents of the Scrap Buffer.
The Cut and Copy commands can be configured to act on the current cursor
line if no Block is marked. This option can be customized using the
configuration program QCONFIG.EXE. Run QCONFIG.EXE, select A)dvanced
options, and return till you get to the option that reads:
Should Cut and Copy use the current line if no block marked (Y/N)? [N]
The default configuration is set to <N> and will result in no action if
the Cut and Copy commands are used outside of a block. If set to <Y>, the
editor will use the current cursor line when the Cut and Copy commands are
issued.
Manipulating Using the Scratch Buffer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A Scratch Buffer is a special type of buffer to which you assign a name.
The editor allows you to create and name up to 99 Scratch Buffers for each
editing session. These can be useful if you have several different Blocks
of text that you want to insert in multiple locations. The commands
StoreScrbuff, AppendScrbuff, and GetScrbuff are used to place text in, and
retrieve text from, a Scratch Buffer. When you issue one of these
commands, the editor will ask you for the name of the Scratch Buffer. The
contents of all Scratch Buffers are discarded when the editor is
terminated.
StoreScrbuff <Ctrl B><S> - will copy the marked Block to the named Scratch
Buffer. The editor will prompt for the name of the Scratch Buffer.
AppendScrbuff <Ctrl B><A> - will append the marked Block to the end of the
named Scratch Buffer. The existing contents of the named Scratch
Buffers are NOT lost. If the named Scratch Buffer does not exist, a
new Scratch Buffer will be created.
GetScrbuff <Ctrl B><L> - will insert the contents of the named Scratch
Buffer at the cursor position.
Manipulating Marked Blocks (Part B)
─────────────────────────────────────────────────────────────────────────────
The editor provides several other ways to manipulate a marked Block.
Manipulation of Marked Blocks can be done by using the Upper, Lower, Flip,
Sort, Fill, Print, and WriteBlock commands. Following is a description of
each of the block manipulation commands along with our default key
combinations.
Upper <Alt 1> - will change all characters in a marked block to upper case.
Lower <Alt 2> - will change all characters in a marked block to lower case.
Flip <Alt 3> - will reverse the case (upper to lower and lower to upper)
of all characters in a marked block.
The Upper, Lower, and Flip commands must be used within the marked block.
If the cursor is outside of the marked block or if no block is marked, the
character at the current cursor position is changed to upper case.
Sort <Shift F3> - will sort a range of lines in ascending order. The sort
key is determined by a marked column block. The length of the column
block determines the range of lines to be sorted.
This command can ONLY be used with a single, non-zoomed window on the
screen.
FillBlock <Ctrl K><L> - will fill an entire block with any ASCII
character. FillBlock is recommended for use with column and word
blocks only because it will fill other type blocks with characters
beyond column 80.
PrintBlock <Alt P><B> - will print the entire contents of the marked
Block. The marked Block must be in the current file.
WriteBlock <Alt W> - will write the marked Block to the named file. The
editor will prompt for the name of the file.
This feature will also allow you to save your current file under a
different name. To do so, press <Alt W> with no marked blocks in the
file. The editor will prompt you for a filename. If the filename
already exists, the editor will prompt you with "Overlay existing
file" and "Append to file". Select the option you desire or press
<Esc> to abort.
If there is a marked block in the file, the WriteBlock command will,
as before, write the current marked block to the named file.
The SemWare Editor Junior's Keyboard Configuration
─────────────────────────────────────────────────────────────────────────────
Are you tired of signing your names to all those messages you write in the
editor? Would you like to change the help screen to the F10 key like it
was in your "other" editor? This is where the editor's flexible keyboard
configuration is extremely helpful. It will provide you with the ability
to assign editor commands and macros to almost any key you prefer. Below
you will find an explanation of the editor's keyboard definition file
(QCONFIG.DAT) and how to modify it to meet YOUR needs.
What is QCONFIG.DAT?
~~~~~~~~~~~~~~~~~~~~
It is The SemWare Editor Junior's keyboard definition file which contains
the default settings for the keyboard. This file contains a list of all
the keys to which commands may be assigned.
The configurable keys are on the left side of the file with the commands
or macros assigned to the keys on the right. Blank lines and lines
starting with an asterisk "*" are ignored. The control, alternate, and
shift keys are used within QCONFIG.DAT to assign to commands. The
following are some examples of each.
- Control keys are specified with "^". (Example: ^F1 means Control F1)
- Alternate keys are specified with "@". (Example: @F1 means Alternate F1)
- Shift keys are specified with "#". (Example: #F1 means Shift F1)
The case of the commands, as well as underscores in command names, are
ignored by the configuration program (QCONFIG.EXE). This means that
CursorDown, cursor_down, and Cursor_Down all refer to the same command.
What are two-keys?
~~~~~~~~~~~~~~~~~~
A two-key is a keystroke sequence assigned to two distinct keystrokes.
This allows for more key assignment possibilities. To assign a command to
a two-key, enter both of the keystrokes of the two-key in the first column
separated by an underline. The key here is that the commands must be
separated by a '_'. For example, to assign the Exit command to the
two-key, <Ctrl F1><F2>, enter the following into your keyboard definition
file:
^F1_F2 Exit
Any editor command can be assigned to a two-key, including macros.
How can I modify MY TSE Jr. keys?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any user can modify his/her keys to suit their needs. It is easy and
simple. Just follow the steps below to modify your QCONFIG.DAT file.
1. Edit QCONFIG.DAT (that is: q QCONFIG.DAT).
2. Make the appropriate changes to your QCONFIG.DAT file.
That is, change the definitions of @0 and ^F2 to be:
@0 InsertDate
^F2 "Joe User" Return
Remember that the first line of a command assignment must
start in column 1. Command assignments can wrap or continue
for multiple lines, as long as each succeeding line starts in
a column greater than 1.
Also remember that text should be enclosed in single or double
quotes.
3. Save your QCONFIG.DAT file.
4. Run QCONFIG.EXE, enter program name and select K)eys
5. Enter keyboard definition name
6. Select S)ave options and quit
You have now installed your new keyboard definitions into the editor. The
next time the editor is loaded, your new keys will be in effect.
What if I liked the keys assignments on my "other" editor?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are many keyboard definition files written by users and SemWare
staff that will allow you to customize your copy of the editor to run like
another editor. You may find these additional keyboard definition files at
http://www.semware.com. To install and/or edit the other keyboard
definition file, follow the steps above with the addition of entering the
new filename when it prompts you for the keyboard definition filename.
The SemWare Editor Junior / Mem-Res Benefits
─────────────────────────────────────────────────────────────────────────────
Have you ever been in a program and wanted to simply jot a note to
yourself? Have you ever had the need to take a quick look at a document,
but the program you were in had no shell option? Then The SemWare Editor
Junior / Mem-Res, the memory-resident version of the editor, is for you!
As a memory-resident version of the editor, TSE Jr./Mem-Res resides in the
background, giving you the power of the editor with a single keystroke,
but without having to exit the file you are working in. Unlike more
familiar TSR programs, TSE Jr./Mem-Res utilizes a unique swapping feature
to provide the benefits of a TSR without draining precious memory. TSE
Jr./Mem-Res uses less than 9k memory, and when popped up swaps your
current applications out of memory and into extended/expanded memory or
to disk. In this configuration, you can edit files up to 400k in size.
The SemWare Editor Junior / Mem-Res contains all of The SemWare Editor
Junior commands, plus four additional commands. These are described below
along with the default key combination for each.
GrabScreen <Ctrl F10> - reads in the contents of the screen, as it
appeared when you popped up TSE Jr./Mem-Res as a marked block at your
current cursor position, and inserts it into the current file as a
marked block. The GrabScreen command behaves as if you were using the
ReadBlock command.
GoBack <ESC><Q><G> - returns you to your DOS application, in the exact
configuration as when you left it. The GoBack command can be
customized to prompt you to save edited files. This is done by using
QMCONFIG, the TSE Jr./Mem-Res configuration program.
Purge <ESC><Q><P> - purges TSE Jr./Mem-Res from memory after first
prompting the user to save any changed files.
TsrPaste - "pastes" a marked block into the foreground application.
TsrPaste does not have a default keyboard assignment. To use this
command, follow these steps:
1) When the foreground application is waiting for input, pop up TSE
Jr./Mem-Res.
2) Within TSE Jr./Mem-Res, mark a block of text and stuff it into the
keyboard buffer with the [TsrPaste] command (available as the last
item on the "Quit" pull-down menu).
3) Quit TSE Jr./Mem-Res and return to the foreground application by
issuing the [GoBack] command, and the text will be immediately
pasted into the foreground application.
Notes: Each line that is pasted, including single lines, has a carriage
return appended to it.
Although The SemWare Editor Junior / Mem-Res has all the features The
SemWare Editor Junior is famous for, most users want a non-TSR editor as
well. For this reason, TSE Jr./Mem-Res currently comes bundled with a
copy of the standard DOS version of The SemWare Editor Junior.
The SemWare Editor Junior's Line/Box Drawing
─────────────────────────────────────────────────────────────────────────────
Do you want to spice up your memos? Do you want to draw boxes around text
to emphasize it? Then the Line/Box-drawing feature is for YOU! Give
emphasis to your documents without the need to use a drawing program. It
is simple and easy to use!
The editor contains two line-drawing commands. These are described below
along with the default key combination for each.
ToggleBoxDraw <Shift F1> - This mode of operation can be switched ON or
OFF. When ON, the cursor movement keys (up, down, right, and left)
can be used to "draw" lines in the text. To switch Line/Box Drawing
mode ON, enter <Shift F1>. To switch it OFF, enter <Shift F1> again.
ToggleBoxType <Alt F1> - This command prompts the user to select from
various line-drawing styles for use in the Line/Box-Drawing mode. The
selectable options are: single, double top, double side, double, and
eraser.
The StatusLine indicates when the line/box-drawing mode is ON. The letter
'B' is displayed on the StatusLine when line/box-drawing mode is selected.
To print the lines/boxes you have drawn in your text file, first set your
printer to use the IBM graphics character set. Then use any of the
editor's printing options.
The SemWare Editor Junior's Conditional Logic for Macros
─────────────────────────────────────────────────────────────────────────────
Have you ever wanted to test to see if the cursor is at the beginning of
the line? Have you ever wanted to perform a task only if you find what
you are searching for in a macro? The editor brings you all the power of
looping and branching in its conditional logic commands.
There are three commands in the editor for use within macros: Jump, JTrue,
and JFalse. Placing one of these commands following another editor
command in a macro allows for branching or looping during macro execution.
All editor commands set an internal result code to either "true" for
successful execution, or "false" for unsuccessful execution or if no
action occurs. The Jump command makes an unconditional jump. The JTrue
command makes a jump only when a result code of "true" is returned.
Likewise, the JFalse makes a jump only for a result code of "false".
Labels can be defined for branching, in the format "label:". The maximum
label length is 15 characters.
For example, here is a macro to delete from the cursor position to the
beginning of the line, and assigned to the f10 key:
f10 begin:
isEndLine
jFalse continue
EndLine
continue:
CursorLeft
JFalse done:
DelCh
Jump begin:
done:
The following macro will delete from just left of the cursor position to
beginning of the line without shifting the remaining text or changing the
cursor position:
f1 setscreenoff * will avoid screen "flicker" when macro is executed
splitline * "saves" the text from the cursor position to eol down
* to the next line without moving cursor to the next
* line
splitline * adds a blank line without moving cursor to next line
delline * deletes the current line, with the blank line
* becoming the current line (cursor position not
* changed)
joinline * joins the next line (which contains our "saved" text)
* to the current line at the cursor position
The SemWare Editor Junior also has three more commands to allow a macro to
conditionally or unconditionally stop execution. These commands,
"MacroQuitTrue", "MacroQuitFalse", and "MacroQuit", can be used to
simplify many macros as in the above example:
f10 begin:
CursorLeft
MacroQuitFalse
DelCh
Jump begin:
In the new version, the "jump to the end of the macro" is replaced with
the MacroQuitFalse command which will halt the macro if the previous
command result is FALSE.
Advanced Macro Commands:
─────────────────────────────────────────────────────────────────────────────
The following commands, intended primarily for macro writers, are designed
to simplify the writing of certain kinds of macros. This group of macro
commands forces the indicated mode or setting. If the setting is already
in that condition, they set the editor's result code to TRUE; otherwise,
they set it to FALSE.
In some cases, a macro can behave differently based on the currently set
editor modes. The following three commands give some control in
establishing the proper environment so that your macro will always work as
intended.
SetInsMode - Sets Insert mode ON. To set Insert mode OFF (that is, set
overwrite mode ON), do the following: SetInsMode ToggleInsert
SetAutoIndentMode - Sets AutoIndent mode ON. To set AutoIndent mode OFF,
do the following: SetAutoIndentMode ToggleIndent
SetWordWrapMode - Sets WordWrap mode ON. To set WordWrap mode OFF, do
the following: SetWordWrapMode ToggleWordWrap
The Find command sounds a tone when the search string cannot be found.
This can be irritating in the case of a long-running macro that may
possibly execute hundreds of finds that fail. The following commands
allow you to selectively turn the sound ON and OFF.
SetSoundOn - Sets sound ON.
SetSoundOff - Sets sound OFF.
Most macros execute dozens of TSE Jr. commands, sometimes hundreds of
times. This can cause the screen to flash rapidly as the macro runs. Not
only is this disconcerting to watch, it actually decreases the speed of
some macros. The following commands allow you to temporarily suspend or
resume screen updating, while a macro is running.
SetScreenOn - Turns screen updating ON.
SetScreenOff - Turns screen updating OFF. You must turn screen updating
back ON before your macro prompts for input, or if there is some
output from the macro that you want displayed on the screen.
NOTE: The editor will AUTOMATICALLY turn screen updating back ON when the
macro has finished executing. Thus, it is not necessary to issue the
SetScreenOn command at the end of the macro.
Many times, it would be nice for a macro to force a few settings, do its
assigned task, and then restore the original settings. The following
commands allow you to do just that. Note that each time SaveSettings is
executed, the previous settings saved with SaveSettings are overwritten.
SaveSettings - Saves the current settings of: Insert, AutoIndent,
WordWrap, Sound, and Screen Updating.
RestoreSettings - Restores the saved settings listed above.
The following commands set the editor's result code to TRUE or FALSE based
on the condition being tested. These commands make certain types of macro
tests easier and more reliable.
isBegLine - Returns TRUE if the cursor is at column 1; otherwise, FALSE is
returned.
isEndLine - Returns TRUE if the cursor is past the last non-white
character on the current line; otherwise, FALSE is returned, including
the case when the cursor is on an empty line.
isEmptyLine - Returns TRUE if the current line is empty or contains only
white space; otherwise, FALSE is returned.
isLastLine - Returns TRUE if the cursor is on the last line of the
currently edited file; otherwise, FALSE is returned.
isFirstLine - Returns TRUE if the cursor is on the first line of the
currently edited file; otherwise, FALSE is returned.
isCursorInBlock - Returns TRUE if the cursor is inside a marked block;
otherwise, FALSE is returned.
To demonstrate how these concepts tie together, consider the following
simple macro to delete all the blank lines in a marked block. The cursor
should be at the beginning of the block when the macro is invoked.
^f9 SetScreenOff * turn OFF screen for speed
begin: isCursorInBlock MacroQuitFalse * exit if not in block
isEmptyLine jFalse next * skip if not empty line
isLastLine jTrue last * special handling for last line
DelLine jump begin * delete empty lines, and loop
next: CursorDown MacroQuitFalse * try next line
Jump begin
last: DelLine * delete the last line
Replacing a CR with a CR/LF
─────────────────────────────────────────────────────────────────────────────
Have you ever loaded a file and gotten the message "long lines split"?
Have you ever had a database file that just had a carriage return at the
end of each line of text? We have developed a small macro that allows you
to replace a visible carriage return (CR) with a carriage return/linefeed
(CR/LF).
The DOS standard specifies that a CR/LF be appended to each line of text
in an ASCII text file. Some databases, as well as the Macintosh, only use
carriage returns at the end of their lines of text in files. The
following macro can be used when you see the carriage return (it will
appear as a musical note) in your text. The macro will replace the
carriage return (ASCII 13) with a carriage return/linefeed (ASCII 13/10).
<key> SetScreenOff * turn OFF screen updating
Find #13 Return 'i' Return * find a carriage-return
MacroQuitFalse * halt if none found
top: DelCh * delete the carriage-return
SplitLine * split the line at that point
CursorDown * move down to the next line
JoinLine * join the next line to current line
BegLine * move back to beginning of line
RepeatFind JTrue top * repeat if another carriage-return found
NOTE: <key> is the key to which you should tie this macro. Once you have
added the macro to your keyboard, run QCONFIG.EXE to install the
changes. To use QCONFIG.EXE, run it, press <Enter> to accept Q.EXE,
press <K> for keys, press <Enter> to accept QCONFIG.DAT, then press
<S> to save your changes.
Eliminating all tabs in your file
─────────────────────────────────────────────────────────────────────────────
Have you ever wanted to get rid of ALL the tabs (ASCII 9) that are in your
text file? It gets pretty frustrating trying to figure out how to do
this, right? The SemWare Technical Support Staff is often asked how to
resolve this problem. You can use the following command to do this.
TabsToSpaces <Esc><O><X>
------------------------------------------------------------
Expands tab characters to the appropriate number of spaces. Tabs within
quotes (single and double) are not expanded. If the cursor is within a
marked Block when this command is executed, only tabs within the Block are
expanded; otherwise, this command operates on the entire file.
Drawing Boxes in Text
─────────────────────────────────────────────────────────────────────────────
Have you ever wanted to box in parts of a text file for emphasis, or to
spice up messages with fancy boxes? We have developed a simple one-key
step for boxing in your text with the editor.
The editor has a versatile line/box-drawing capability. But since most of
us like to make text editing as simple as possible, we took the editor's
box-drawing feature and incorporated it into two different versions of a
macro. Each version takes a column block, marked word, or character block
that the user marks and draws a box around the text. Then, depending on
which version is used, it reinserts the boxed text into your file in one
of two ways: "insert" or "overwrite."
Give one of the versions of the macro a try and see how it gives your text
files an exciting new look!
This version of the macro will box the text and re-insert it WITHOUT
overwriting other text in the file.
<key> SetScreenOff EditFile "nul" Return Quit GotoBlockEnd AddLine
GotoBlockBeg InsertLine Cut EditFile Return GotoColumn '2' Return
Paste InsertLine GotoBlockEnd ToggleBoxDraw upagainr: CursorUp
JTrue upagainr leftagaint: CursorLeft JTrue leftagaint
GotoBlockEnd CursorDown leftagainb: CursorLeft JTrue leftagainb
upagainl: CursorUp JTrue upagainl CursorRight ToggleBoxDraw
UnMarkBlock BegFile MarkColumn EndFile EndLine CursorLeft Copy Quit
Paste UnMarkBlock
This version of the macro will box the text and re-insert it into the file
while overwriting text surrounding the block with the new box.
<key> SetScreenOff EditFile "nul" Return Quit GotoBlockBeg Cut Paste
FillBlock " " Return CursorUp CursorLeft EditFile Return
GotoColumn '2' Return Paste InsertLine GotoBlockEnd ToggleBoxDraw
upagainr: CursorUp JTrue upagainr leftagaint: CursorLeft
JTrue leftagaint GotoBlockEnd CursorDown leftagainb: CursorLeft
JTrue leftagainb upagainl: CursorUp JTrue upagainl CursorRight
ToggleBoxDraw UnMarkBlock BegFile MarkColumn EndFile EndLine
CursorLeft Cut Quit PasteOver UnMarkBlock
NOTE: <key> is the key to which you should tie each macro.
Once you have added the macro to your QCONFIG.DAT file, run
QCONFIG.EXE to install the changes. To use QCONFIG.EXE, run it, press
<Enter> to accept Q.EXE, press <K> for keys, press <Enter> to accept
QCONFIG.DAT, then press <S> to save your changes.
Loading a Filelist into The SemWare Editor Junior
─────────────────────────────────────────────────────────────────────────────
Do you often work with the same group of files? Does it take you awhile
to load these files? If so, you are like many others who use the same
files quite often and who spend a lot of time loading them into the
editor. Now you can use the flexibility of the editor to load ALL those
files with a single keystroke.
To use the following macro to load your list of files, first create a
file (that is, FILELIST). Then list each one of the files you need to
load (including its path) on separate lines. Finally, save that file
for future use (note that you may have several lists of files for
different needs). In the future you can just load your filelist into
the editor and run the macro. Notice that since you have not actually
viewed the files yet, they will not be loaded until you move to them
the first time . This will permit the user to take care of any "Press
Escape" prompts.
The end result will be to load each of the files in the filelist into the
editor in the order that they were listed and to remove the FILELIST from
the current file ring.
<key> SetScreenOff * turn OFF screen updating
EndFile * go to end of FILELIST file
repeat: UnMarkBlock * make sure no block is marked
MarkLine * mark the current line
Copy * copy it to the scrap buffer
* the following line will place the name of the file just
* copied to the scrap buffer, in the file ring immediately
* following the LISTFILE. Doing this repeatedly in reverse
* order will place the file in the ring in the desired
* order while remaining in the FILELIST file.
EditFile CurrentFilename " " Paste Return
CursorUp JTrue repeat * repeat while we can cursor up
Quit * Quit the FILELIST file
NextFile * move to the first file in the ring
NOTE: <key> is the key to which you should tie this macro. Once you have
added the macro to your QCONFIG.DAT file, run QCONFIG.EXE to install
the changes. To use QCONFIG.EXE, run it, press <Enter> to accept
Q.EXE, press <K> for keys, press <Enter> to accept QCONFIG.DAT, then
press <S> to save your changes.
Macro Table is Full
─────────────────────────────────────────────────────────────────────────────
Are you running out of macro space in the editor? Does the editor respond
with a MACRO TABLE FULL error when installing your keys? Then it looks
like you need more space for editor macros. Although the configuration
area for key definitions is fixed in the editor, there still is a
solution. Setting up external macro files are a good way to add macros to
the editor when the macro table is full.
The configuration area for key definitions holds approximately 2000 bytes
of information. When that space is full, you will receive an error
message: 'macro table full at line #:'. One solution is to go into your
keyboard definition file (normally QCONFIG.DAT) and delete macros that are
no longer needed. Alternatively you can move several of your larger macros
to an external macro file and compile it with QMAC, TSE Jr.'s external
macro compiler. Each of these external macro files can be up to 4k in
size and you can generate as many such files as needed. Thus, users have
access to an unlimited amount of macro space through the use of external
macro files.
For example, create a macro file named MYMACS.MAC that has several of your
larger macros included in it. Next create a batch file, such as Q.BAT, to
run the editor, and load your macros. To eliminate confusion about where
you execute Q.BAT, rename Q.EXE to TSEJR.EXE. The batch file will then be
similar to the following:
tsejr %1 %2 %3 %4 %5 %6 %7 %8 %9 -lmymacs.mac
The batch file loads TSE Jr., loads up to nine files on the command line,
and loads the external macro file. Modifications to the 'mymacs.mac'
section of the batch file may be needed, depending on the name of your
macro file and its location on your system.
The end result is a keyboard definition file with more space available,
plus an easy way to load the deleted macros in an external macro file.
All this with still just the touch of one keystroke!
Printing to LPT1 and LPT2
─────────────────────────────────────────────────────────────────────────────
Have you ever wanted to print to another printer port in the editor? Do
you have two printers and want to toggle between them?
As shipped, the editor's printer routines output all data to PRN, which
usually points to LPT1. A number of users have expressed a need to print
to LPT2, or to toggle between LPT1 and LPT2. In response, you can select
the device to print to, PRN, LPT1, LPT2, LPT3, or even a disk file.
This printer output device can be set permanently via QCONFIG, or
temporarily inside the editor via the Print pull-down menu.
Inserting Text at the same column
─────────────────────────────────
Sometimes you may want to add a word, or phrase, at the same location on
more than one line in a file. It is possible to do this with some help
from the FillBlock command.
Let us assume that you want to insert the word "number" before each number
in the following text:
this is line 1
this is line 2
this is line 3
this is line 4
this is line 5
this is line 6
First use the MarkColumn command <ALT K> to mark the single column of
numbers, so that we have a one column wide block that spans the six lines.
Move the cursor to "1" and issue the CopyBlock command <ALT C> so that we
have:
this is line 11
this is line 22
this is line 33
this is line 44
this is line 55
this is line 66
^
|--- This single column is marked.
Issue the FillBlock command <CTRL KL>. Specify the character to "fill" the
block and then press <Enter>. Let's assume we specified "." to fill the
block. We now have:
this is line .1
this is line .2
this is line .3
this is line .4
this is line .5
this is line .6
^
|--- This single column is marked.
Issue the FindReplace command <CTRL QA>. Specify "." in the "Search for:"
prompt and press <Enter>. Specify "number " (note the trailing space) in
the "Replace with:" prompt and press <Enter>. Specify "LGN" in the
"Options" prompt and press <Enter>. "L" causes the operation to be
limited to the marked block, "G" causes the operation to start at the
beginning of the marked block, and "N" will cause all changes to be made
with "no prompting" to the user. We now have:
this is line number 1
this is line number 2
this is line number 3
this is line number 4
this is line number 5
this is line number 6
^
|--- This single column is still marked, so just
issue the UnmarkBlock command <ALT U>.