TextHelper is simple editor based on the MultiLineEditor class from the IBM Open Class Library. The programmer has added some text manipulation functions and special support for printing on HP Deskjet and Laserjet printers. If you do not have a compatible printer, there is also a generic printer option.
Note: TextHelper should not be used on large files. It should be limited to files less than 100K bytes or less than 4000 lines. TextHelper can load larger text files, but the overhead of handling the text becomes excessive and some functions are disabled.
TextHelper is not intended to replace any full functioned editor. Its value is in printing and its text manipulation.
If you have a HP DeskJet or compatible printer it has the ability to print in Landscape or Portrait mode; on US letter, US legal, and Euro A4 sized paper and envelope sizes; in 5, 10,12, 16, or 20 characters per inch or proportional; in 3, 4, 5, 6, 8, 10 ,12 lines per inch; 6, 12, or 24 character point size; in bold or letter quality mode; with or without line numbers; with or without a 3 hole punch margin; and in combinations of those options.
One useful feature of TextHelper is the pseudo-wysiwyg printing. The following is an example of how it works.
Remove the hard coded cr-lf pairs with the De-wrap text in editor selection. The function may be
selected from the menu or by pressing the F8 key.
The turn the display line wrap back on by using the Word Wrap selection from the menu or by pressing the
Ctrl+W combination. Adjust the longest line displayed by changing the Font and the editor window width until the desired
line length is obtained. This can be checked by the Get lines information selection from the menu or by
pressing the F6 key.
The Font changes only effect the displayed
text, they are not sent to the printer. The font is changed only to change
the number of characters in the displayed line.
Now print using the Print On Selected Printer
selection.
Note: The longest line sent to the printer still needs to be
short enough to fit on the paper. Printing in Landscape mode with a
smaller printer font will allow you to print longer lines. To change the
font selection sent to the printer you must use the HP
DeskJet Compatible Printer Options menu selection.
Unless the option to Hard code word wrap is
used, the word wrap is not saved when or if you save the file.
TextHelper has the option to create backups if you Enable Making Backups and Enter The Backup Path
I suggest that you enable making backups and enter a backup path. The making of backups does not take much CPU time, and can save the user a lot of effort.
TextHelper does not save any of the configuration options or the window size and position unless the Save Settings menu selection is used.
If you wish to have multiple configurations of TextHelper on your desktop, you will need to select a different working directory for each instance and copy a TEXTHELP.INI file to that directory.
If you intend to launch TextHelper from the command line, you may wish to set an envioronment variable so that TextHelper can find its help file and INI file. Add the following line to your CONFIG.SYS file.
SET TEXTHELPER=(DRIVE):\(DIRECTORY)
Note: There must be no space before the equal sign.
Replacing (DRIVE) with the drive letter and (DIRECTORY) with the directory where you installed TextHelper .
Note: UnZip is an Info-ZIP program is not part of TextHelper and must be in the search path.
If the file name is "file.name" and the backup file will be named "file.name.000" unless that file already exits. If it does then the backup count number will increment until the file name does not exist in the backup directory.
If the file "file.name" has been edited and saved five times
with the backup option enabled, the following files will exist in the
backup directory.
file.name.000
file.name.001
file.name.002
file.name.003
file.name.004
Note: The backup option will not work if the backup directory is on a FAT formatted drive.
Under "Options"/"Filename Settings" there are two settings that control how spaces in the marked text are handled. If you select "Replace Spaces with Underscore Characters", spaces in the text will be replaced with underscore characters. If you select "Leave Spaces in Filename", the spaces will not be replaced. If there are any characters that should not be used in a filename, they will be replaced with spaces or underscores.
This is best done by first using the "De-wrap text in editor" menu selection. This removes the cr-lf pairs unless there are two sequential cr-lf pairs. There are two cr-lf pairs at the end of each paragraph. This menu selection turns off word wrap, so the user must reselect word wrap - the Control+W key combination is a shortcut to restore word wrap. Then press the F6 key to get the width of the longest line. Then by selecting the size of the font used in the editor window and the width of the edit window the user can determine the longest line of the text sent to the printer. The user can then select the desired printer options to allow the text to be printed correctly.
Note: The longest line sent to the printer still needs to be short enough to fit on the paper.
This is best done by first using the "De-wrap text in editor" menu selection. This removes the cr-lf pairs unless there are two sequential cr-lf pairs. There are two cr-lf pairs at the end of each paragraph. This menu selection turns off word wrap, so the user must reselect word wrap - the ControlW+W key combination is a shortcut to restore word wrap. Then press the F6 key to get the width of the longest line. The by selecting the size of the font used in the editor window and the width of the edit window the user can determine the longest line of the text sent to the printer. The user can then select the desired printer options to allow the text to be printed correctly.
Note: The longest line sent to the printer still needs to be short enough to fit on the paper.
John Q. Public
1234 Anywhere Street
Neptune, Ca. 91209
Donald Hawkinson
2633 8th Avenue
Lindsborg, Kansas 67456-5111
USA
All the user needs to do is set the paper size to one of the envelope selections and have the addressing information in the editor window.
The "To" information will be printed in small print in the left hand corner of the envelope. The blank line will cause the program to skip down several lines, set the left hand margin, and set the font size. The font size depends on how many characters are in the longest line of the address.
The "From" information will then be printed with any further blank lines being treated as blank lines. If there are more than four lines after the blank line and the font is set to 5 characters per inch, the address may flow over to a new page. To resove this problem pad one of the "To" address lines with spaces to make it longer than 30 charaters.
It is not necessary to load an envelope in the printer to use this menu selection. A regular page may be used to test the output or make a label for a package. If you are making a mailing label for a package, you can select the A5 page option and the Print Envelope option will still be available.
This command will put a HP Deskjet compatible printer into the default state so that any programming from the last job sent to the printer will not included in further printing.
This includes the contents of the editor and the source file on the hard drive.
None of the whole file actions can be undone by the Undo function.
The search method used is line oriented and only the first instance of the search string in each line will be marked. If the Search Again function is selected, the search will begin on the next line.
If the wildcard option is checked, only the first character of the line where the match was found will be marked.
When the the wildcard options is enabled, the search pattern is not marked when a match is found. Only the first character of the line where the pattern was found is marked.
The search and replace function uses a different algorithm and will change all occurrences of the search string.
The text in the editor is treated as one large string for the search and replace function, and the overhead increases significantly as the file size increases.
http://www.fourmilab.ch/webtools/demoroniser/
The URL is for a windows program, but the text does a good job of describing "smart quotes". The following text was "borrowed from that web page.
You see, "state of the art" Microsoft Office applications sport a nifty feature called "smart quotes." (Rule of thumb--every time Microsoft use the word "smart," be on the lookout for something dumb). This feature is on by default in both Word and PowerPoint, and can be disabled only by finding the little box buried among the dozens of bewildering option panels these products contain. If enabled, and you type the string,
"Halt," he cried, "this is the police!"
"smart quotes" transforms the ASCII quote characters automatically into the incompatible Microsoft opening and closing quotes. ASCII single and double quotes are similarly transformed (even though ASCII already contains apostrophe and single open quote characters), and double hyphens are replaced by the incompatible em dash symbol. What other horrors occur, I know not. If the user notices this happening at all, their reaction might be "Thank you Billy-boy--that looks ever so much nicer," not knowing they've been set up to look like a moron to folks all over the world. You see, when you export a document as text for hand-editing into HTML, or avail yourself of the "Save as HTML" features in newer versions of Office applications, these incompatible, Microsoft-specific characters remain in place. When viewed by a user on a non-Microsoft platform, they will not be displayed properly--most browsers seem to just drop them, as opposed to including a symbol indicating an undisplayable character. Hence, the apparently ungrammatical text, which the author of the page, editing on a Microsoft platform, will never be aware of.
The following is a explanation of the MIME encoding that this menu selection removes from the text in the editor. The text was borrowed from the following URL.
http://www.mhonarc.org/~ehood/MIME/2045/rfc2045.html
MIME Quoted-Printable Content-Transfer-Encoding
The Quoted-Printable encoding is intended to represent data that largely consists of octets that correspond to printable characters in the US-ASCII character set. It encodes the data in such a way that the resulting octets are unlikely to be modified by mail transport. If the data being encoded are mostly US-ASCII text, the encoded form of the data remains largely recognizable by humans. A body which is entirely US-ASCII may also be encoded in Quoted-Printable to ensure the integrity of the data should the message pass through a character-translating, and/or line-wrapping gateway.
In this encoding, octets are to be represented as determined by the following rules:
1. (General 8bit representation) Any octet, except a CR or LF that is part of a CRLF line break of the canonical (standard) form of the data being encoded, may be represented by an "=" followed by a two digit hexadecimal representation of the octet's value. The digits of the hexadecimal alphabet, for this purpose, are "0123456789ABCDEF". Uppercase letters must be used; lowercase letters are not allowed. Thus, for example, the decimal value 12 (US-ASCII form feed) can be represented by "=0C", and the decimal value 61 (US-ASCII EQUAL SIGN) can be represented by "=3D". This rule must be followed except when the following rules allow an alternative encoding.
2. (Literal representation) Octets with decimal values of 33 through 60 inclusive, and 62 through 126, inclusive, MAY be represented as the US-ASCII characters which correspond to those octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN through TILDE, respectively).
3. (White Space) Octets with values of 9 and 32 MAY be represented as US-ASCII TAB (HT) and SPACE characters, respectively, but MUST NOT be so represented at the end of an encoded line. Any TAB (HT) or SPACE characters on an encoded line MUST thus be followed on that line by a printable character. In particular, an "=" at the end of an encoded line, indicating a soft line break (see rule #5) may follow one or more TAB (HT) or SPACE characters. It follows that an octet with decimal value 9 or 32 appearing at the end of an encoded line must be represented according to Rule #1. This rule is necessary because some MTAs (Message Transport Agents, programs which transport messages from one user to another, or perform a portion of such transfers) are known to pad lines of text with SPACEs, and others are known to remove "white space" characters from the end of a line. Therefore, when decoding a Quoted-Printable body, any trailing white space on a line must be deleted, as it will necessarily have been added by intermediate transport agents.
4. (Line Breaks) A line break in a text body, represented as a CRLF sequence in the text canonical form, must be represented by a (RFC 822) line break, which is also a CRLF sequence, in the Quoted-Printable encoding. Since the canonical representation of media types other than text do not generally include the representation of line breaks as CRLF sequences, no hard line breaks (i.e. line breaks that are intended to be meaningful and to be displayed to the user) can occur in the quoted-printable encoding of such types. Sequences like "=0D", "=0A", "=0A=0D" and "=0D=0A" will routinely appear in non-text data represented in quoted-printable, of course.
Note that many implementations may elect to encode the local representation of various content types directly rather than converting to canonical form first, encoding, and then converting back to local representation. In particular, this may apply to plain text material on systems that use newline conventions other than a CRLF terminator sequence. Such an implementation optimization is permissible, but only when the combined canonicalization-encoding step is equivalent to performing the three steps separately.
5. (Soft Line Breaks) The Quoted-Printable encoding REQUIRES that encoded lines be no more than 76 characters long. If longer lines are to be encoded with the Quoted-Printable encoding, "soft" line breaks must be used. An equal sign as the last character on a encoded line indicates such a non-significant ("soft") line break in the encoded text.
Thus if the "raw" form of the line is a single unencoded line that says:
Now's the time for all folk to come to the aid of their country.
This can be represented, in the Quoted-Printable encoding, as:
Now's the time =
for all folk to come=
to the aid of their country.
This provides a mechanism with which long lines are encoded in such a way as to be restored by the user agent. The 76 character limit does not count the trailing CRLF, but counts all other characters, including any equal signs.
Since the hyphen character ("-") may be represented as itself in the Quoted-Printable encoding, care must be taken, when encapsulating a quoted-printable encoded body inside one or more multipart entities, to ensure that the boundary delimiter does not appear anywhere in the encoded body. (A good strategy is to choose a boundary that includes a character sequence such as "=_" which can never appear in a quoted-printable body.
Note: The longest line that can be loaded into TextHelper is 32768 characters. If the de-wrapped text contains lines that are 32768 characters or longer, the text will not be loaded into the editor.
The program starts at the 15th character and moves toward the start of the line looking for a forwarding mark. When a forwarding mark is found, the front of the line is truncated including the forwarding mark.
It has no valid use, but is there because the function was part of the IBM Open Class Library IString class and the programmer found it entertaining.
/rot ther'teen/ [Usenet: from "rotate alphabet 13 places"], v. The simple Caesar-cypher encryption that replaces each English letter with the one 13 places forward or back along the alphabet, so that "The butler did it!" becomes "Gur ohgyre qvq vg!" Most Usenet news reading and posting programs include a rot13 feature. It is used to enclose the text in a sealed wrapper that the reader must choose to open - e.g. for posting things that might offend some readers, or spoilers. A major advantage of rot13 over rot(N) for other N is that it is self-inverse, so the same code can be used for encoding and decoding.
From Wikipedia, the free encyclopedia
ROT13 replaces each letter by its partner 13 characters further along the alphabet. For example, HELLO becomes URYYB (or, decrypting, URYYB becomes HELLO again).
ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple Substitution cipher used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance. ROT13 has been described as the "Usenet equivalent of a magazine printing the answer to a quiz upside down". ROT13 is a variation of the Caesar cipher, developed in ancient Rome.
ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding. The algorithm provides no real cryptographic security and is not normally used for such. It is often cited as a canonical example of weak encryption. ROT13 has inspired a variety of letter and word games on-line, and is frequently mentioned in newsgroup conversations.
The cipher is also sometimes known as EBG13 or EBG-13 because "EBG13" is "ROT13" in ROT13.
The information reported is affected by the Word Wrap option.
The online information for Print On Selected Printer has more on how to use the information reported by this menu selection.
Note: If the number entered is greater than the number of lines in the editor, no error message will be displayed and the cursor will be moved to the last line.
The timestamp is in 24 hour format.
It may not be that useful, but the function was part of the IBM Open Class Library IString class and the programmer found it entertaining.
Note: This function is limited to the text in a single line and must not include the new line characters (which appear as spaces at the end of the line). The function will not execute if a carriage return or line feed is included in the marked text.
It may not be that useful, but the function was part of the IBM Open Class Library IString class and the programmer found it entertaining.
Note: This function is limited to the text in a single line and must not include the new line characters (which appear as spaces at the end of the line). The function will not execute if a carriage return or line feed is included in the marked text.
It is intended to center a title, but will work on any line.
Colors must set by drag and drop from one of the color palettes. To set the text colors, hold down the cntrl key while doing the drag and drop.
To change the font for the menubar or the information area below the main window, use the OS/2 font palette and drag and drop a new font on either area. The font colors may also be changed be drag and drop if the control key is held down and the color dropped on the text.
Note: The font selections are only saved when Save Settings is selected.
The 'Reset to default colors' option restores TextHelper to the system default background and foreground colors.
To change the colors on the menubar, main window, or the information area use the OS/2 color palette and drag and drop a color selection. When Save Settings is selected , the current color selections are saved.
Note: The font colors are reset by this selection.
Note: The Word Wrap is a software word wrap and it does not insert hard carriage return - line feed pairs.
This menu selection opens a pull-down menu that contains selections to configure the filename, backup, and default load path options.
See Save As Marked for more on how this option is used.
See Save As Marked for more on how this option is used.
If the file name is "file.name" and the backup file will be named "file.name.000" unless that file already exits. If it does then the backup count number will increment until the file name does not exist in the backup directory.
If the file "file.name" has been edited and saved five times
with the backup option enabled, the following files will exist in the
backup directory.
file.name.000
file.name.001
file.name.002
file.name.003
file.name.004
Note: The backup option will not work if the backup directory is on a FAT formatted drive.
The file is created in the working directory and may be opened by any file viewer such as List or any editor including TextHelper.
Note: The list is the one supported by the HP DeskJet 632c. If you need a character set that is not listed, contact the author.
Note: The list is the one supported by the HP DeskJet 632c. If you need a character set that is not listed, contact the author.
One of the supported lines per inch options
One of the supported character per inch options in a courier font Bold option
Adds a bold attribute to the printed characters Proportional Font
Selects a proportional font that is approximately 14 characters per inch. Letter Quality Mode
Adds a Letter Quality mode to the printed characters. Italic Proportional font
Selects an italic proportional font that is approximately 14 characters per inch.
Do not change point size, leave at default size. Character Point Size Option
One of the supported character point size options.
6 point is the smallest and used with the 10 or 12 lines per inch
option
12 point is nornal on my printer, but it may not be on other printers
24 point is the largest and should be used with the 3 or 4 lines per
inch option.
This option may work for other HP printers or HP PCL compatible printers that have internal duplex functions.
Note: The HP DeskJet 632c printer does not have a duplex function, so this function is untested.
Note: The settings are saved in a file named texthelp.ini that is located in the same directory as the executable unless an environment varaible is set by a line added to the CONFIG.SYS file.
SET TEXTHELPER = <drive>: \ <path>
This line would allow TextHelper to be started from any directory and the settings file to be found.
Note: The editor is opened with the saved settings, not the settings of the currently opened copy of TextHelper.
Note: If the OS/2 or eCS clipboard is empty or does not contain text, a new copy of TextHelper is not opened.
Note: The editor is opened with the saved settings, not the settings of the currently opened copy of TextHelper.
If the following text is used as the command template.
copy %s
Then the files selected will be applied to the command template and the following will be inserted in the edit window.
copy L:\IBMCPP\SAMPLES\IOC\TH\ADIALOG4.CPP
copy L:\IBMCPP\SAMPLES\IOC\TH\ADIALOG4.DLG
copy L:\IBMCPP\SAMPLES\IOC\TH\ADIALOG4.HPP
copy L:\IBMCPP\SAMPLES\IOC\TH\adialog4.lst
copy L:\IBMCPP\SAMPLES\IOC\TH\aextent.cpp
Note: Zip is an Info-ZIP program is not part of TextHelper and must be in the search path.