Date: Saturday, May 27, 1995 From: Todd@nohost.com [Todd Eckrich] Re: Machine Code Text Formatter --> S/SX/G/GX STR22 - for ordinary editing on HP48 STR24 - for printing to HP 82240 Thermal Printer STR33 - for Jazz (ED & VV) STR80 - for printing to normal full-page printer Author: Todd Eckrich ( mte@delphi.com ) Subject: ALIGN, version 1.0 ( Text Formatter for HP48 S/G Series ) BYTES: # 2D4Ah 111 This small program formats text to fit within the 22-character wide display. The way it does it, however, is different than other similar programs. A machine code routine simply rearranges the space and linefeed characters in two passes. The first pass simply replaces all linefeeds with spaces. The second pass puts a linefeed at the first space encountered backwards from the 23rd character of each line. As a result, words do not get haphazardly split and the program is extremely fast. If there are more than 22 consecutive nonspaces, then the 23rd character is replaced with a linefeed. The argument is a character string. If anyone is interested, I wrote a similar program to format text for use with JAZZ's ED and VV. It does not work for formatting source code. It is intended more for text, especially editing large text files. [Note: See ED33 and VV33 for formatted editing and viewing in the Jazz 33-char font. What we *really* need is a program that takes two arguments, a string and a desired line width, then uses Todd's method to format the string to that width. -jkh-]