This article was originally written to answer the following problem:

I simply can't save a file — in any form or under any code page assignment with WordStar — that can later be viewed properly with DOS (as is done with the TYPE or MORE commands to view a batch file that uses extended characters above 127) — UNLESS I convert it first with Star Exchange. This fact leaves me wondering what "non-document" really means with WordStar — and why it's necessary to resort to various lesser known utilities to prepare its files for viewing under DOS.



Let us start with the recognition that WordStar is probably the only major 'word processing' program — as opposed to text-editing program — that ever had a non-document mode, and that this mode is a historical oddity dating from WordStar 3.3x and earlier, when WordStar didn't support anything except real 7-bit ASCII.

Given those facts, we can say that non-document mode is a mode in which WordStar does not force (or offer) word-wrapped margins as you enter text, does not set the high (8th) bit on the final character of words to indicate that the line has been wrapped, does not set the high bit on carriage returns to indicate a soft (word-wrapped) return, does not set the high bit on line feed characters to indicate a page break, and generally inserts ASCII tabs instead of user-specified numbers of spaces when you press the TAB key. In other words, it's the opposite of document mode. It's useful as a programming editor in this mode. Most programming languages use only ASCII characters.

Non-document mode still means those things. However, more recent versions of WordStar attempt to support both the use of older files (which used the 8th bit to indicate formatting) and the printing of characters that use the 8th bit, i.e., non-ASCII characters such as the 'cents' character. WordStar 4 and later do this by inserting fence characters (1B hex and 1C hex) around each character that requires having the 8th bit set. If you remove the fences, the 8th bit is assumed to indicate formatting and the 7-bit equivalent character is displayed by WordStar. The fences were put in for document mode, but are not removed simply by opening or unformatting a file in non-document mode because that would change the meaningful contents of the file.

In other words, regardless of code page, if you use WordStar as it was designed (7-bit characters only) you can display ASCII files created with WordStar's non-document mode under MS-DOS's TYPE command. If you put in characters that require the 8th bit set you will not be able to do this because WordStar uses that 8th bit to mean two different things, and requires fences to distinguish the uses.

Printing to file with ASC256.PDF is documented in the manual as the official way to produce disk files that preserve all 256 possible values of an 8-bit byte, which seems to be what you want to do. It comes with WordStar — run PRCHANGE, it's right there next to the ASCII.PDF, which produces files using 7-bit ASCII only — and everyone has it whether they read the manual or not.

Peter Mierau's WSASC.COM is a lesser-known utility: it's not part of WordStar, it's documented only in its help information, and not everyone has it. Nonetheless, it's faster than printing with ASC256.PDF, and I recommended it because it's more convenient under some circumstances.

I hope this explains both what is happening, and why (historically) it happens that way. I hope that you now understand you have several options (not only Star Exchange) for eliminating the fence characters from files you plan to use outside of WordStar, and I hope, too, that you will see that text editors (as opposed to word processing programs) might make you jump through fewer hoops because they don't offer the formatting options you're trying to avoid.

I think of VDE (for example) as WordStar's non-document mode with word-wrap added. VDE is shareware; it's reasonably WordStar-like in its behavior, and very quick. It does have a 75k-80k filesize limit (partially lifted in the latest revision).

Based on information originally posted on the WordStar maillist by Mark Fishman