ASCIIform

by Richard Lancaster


ASCIIform allows standard text manipulation facilities, such as formatting, justification and some basic styling functions, to be applied to pure ASCII text files. This is necessary because Edit, Acorn's text editor, doesn't itself supply them. ASCIIform can therefore be used for tasks such as formatting Help and ReadMe files, and for pre-formatting textual resource files for use within home-grown applications.

ASCIIform will format ASCII text files of type &fff and DOS text files of filetype &fe4 with a DOS extension of '.TXT'. The only restriction is that new line characters must only be positioned at the end of paragraphs and not in the middle of sentences. This is because ASCIIform uses the new line characters to decide where the paragraph breaks are in the text, meaning that any new line characters in the middle of the paragraph will confuse ASCIIform and produce spurious results in the formatted text.

USING ASCIIFORM
Load ASCIIform by double-clicking on its icon.

Open the Options window, either by clicking with Select on ASCIIform's icon on the icon bar, or by selecting Options from ASCIIform's icon bar menu. This window allows you to select how you want the text file formatted.

Select the formatting options by clicking on their corresponding icons in the Options window.

Drag the text file to be formatted onto ASCIIform's icon on the icon bar.

After a short wait while the file is loaded and formatted, a Save as box will appear. Type in a suitable filename and save the file. It is advisable to use a different name from the original, as you will not easily be able to undo the formatting process. It is also impossible to pass a file that has already been formatted by ASCIIform back through for reformatting. This is because ASCIIform, like Edit, inserts new line characters into sentences to format the text.

You can then either drag another file into ASCIIform, or quit the program by selecting Quit from the icon bar menu.

OPTIONS
The following is a description of the functions of each option selectable in the Options window:

Format text to
This writable icon at the top of the window sets how many columns the text is to be formatted to. This works in a similar fashion to Edit's Format text command. Deselecting this option will prevent you from using the justification or double-space options, as these rely on having the text formatted.

Justification type
This set of radio icons allows you to select the type of justification to be used.

Double space
Selecting this option will double-space the text in the document.

Ensure blank line between paragraphs
This option will ensure that there is a blank line between each paragraph in the text.

Ensure 'x' space indent to new paragraphs
This function will ensure that there is an indent of 'x' spaces at the start of each new paragraph. A value of zero will ensure that the paragraphs are not indented. It is also not advisable to use this function along with centre justification, as an indent at the start of a centered paragraph can look rather odd.

Ensure 'x' spaces after '.'
Selecting this function will make ASCIIform ensure that there are 'x' spaces after every full stop in the text file being formatted. A value of zero in the writable icon will ensure that there are no spaces after full stops in the text.

Ensure 'x' spaces after '!'
As with the above function, but acting on exclamation marks rather than full stops.

Ensure 'x' spaces after '?'
As above, but acting on question marks.

Ensure 'x' spaces after ':' & ';'
As above, but acting on colons and semi-colons.

Ensure 'x' spaces after ','
As above, but acting on commas.

Note that all of the preceding functions can be used to both remove spaces as well as add them.

Use as new line character
These two radio icons are positioned at the very bottom of the options window. This function allows you to select the ASCII character that you want to be used to represent new line characters. The top radio icon allows you to select character &0a (or linefeed) as the new line character. This character is commonly used as a new line character by programs running under RISC OS. The bottom radio icon allows you to select character &0d (or carriage return) as the new line character. This is the character that is commonly used by programs running under DOS.

WARNING
If full justification is used when any of the 'Ensure 'x' space' functions are selected, then the spaces added by these functions may be expanded by the justification process. This means that with full justification applied, you cannot be assured of getting exactly 'x' spaces after each punctuation mark.

UNFORMATTING TEXT FILES
Although it is not possible to use ASCIIform to format a pre-formatted text file, all is not lost. It is possible, to some extent, to unformat a text file in a package such as Edit. This can be achieved by the following method:

Load the formatted text file into Edit.

Format the entire text file using Edit's Format text command with width set to 99999999. If you are unfamiliar with this command then refer to the RISC OS User Guide.

Now save the file back to disc.

Finally format the file in ASCIIform as usual.

USING HARD SPACES
When full justification is used on a file, the number of spaces between each word is generally increased. However in some cases, for example if there was a section of program code embedded in the text, it might not be desirable to expand all the spaces. It is therefore possible in such critical places to prevent such expansion but still utilise full justification on the rest of the text. This can be achieved by replacing these critical spaces with hard spaces. Since the computer does not expand such hard spaces during the justification process, these critical spaces will remain their original length.

A hard space can be created by holding down the Alt key and then pressing the Space bar. You may be confused by the result of this as the hard space appears to be exactly the same as a standard space. However the computer can tell the difference and will be able to format the text file correctly.


 Copyright RISC User 1993
