[net.cog-eng] How do you tell users to press RETURN every so often? --- Don't

avi@pegasus.UUCP (11/14/83)

tell them
References: <2679@utcsrgv.UUCP>

Dave (Sherman: utcsrgv!dave) --

You wanted to know how to read more than 256 characters per "line", or
convcince the typical lawyer to hit <CR> every now and then. It sounds
easiest to take the path of least resistance and not argue with lawyers. :-)

It sounds like your problem is caused by the fact that you are using the
terminal in cooked mode. Therefore, canonical line processing will throw
away lines as soon as the skimpy 256 character buffer is filled. I think
part of your problem is that you are using the tty driver in this efficient
(but rather useless) mode.

I just tested out my "ksh" (Korn Shell) -- which is running in emacs
emulation mode and IS READING MY INPUT A CHARACTER AT A TIME. Any reasonable
length line is accepted. I have just tested a quick shell that will do
exactly what you asked (well, actually a bit more). It will work when run as
". shell-script":
	while [ "$DONE" != "TRUE" ]
		do print - $LINE >>comment-file; read LINE;
		   case "$LINE" in
			"." | [dD][oO][nN][eE] ) DONE=TRUE;;
		   esac
		done

This will accept lines of any reasonable length. In addition, the line slides
over half a screen as you fill it in. It never gets a chance to spill over
the edge of the screen. I know Dave Korn had a talk at the Toronto UniForum
(or whatever it was called -- I did not have the time to attend this time).
I have no idea if the Korn Shell is available outside the current AT&T
family, or whether it runs on an 11/23. Even if you used this, you would
probably wany to place the output through another filter that would generate
the usual 80 column format.

On a more useful note, how about placing the user in your own editor,
running in an appropriate mode (raw or cbreak) and breaking the lines every
time a word wanders too far. Appropriate code can easily be found in one of
the full-screen editors (do you have a source license?), or could rather
easily be written. In any case, the 256 character limit does not apply any
longer.

The user really should not have to worry about pressing carriage returns. I
understand that some terminals will overprint the last column until they get
a carriage return. In this case, YOU can insert the <CR> whenever they
approach the end of the line. I can't think of any other special terminal
dependencies that would cause you a problem.

		Good Luck with your CAI,
-- 
-=> Avi E. Gross @ AT&T Information Systems Laboratories (201) 576-6241
 suggested paths: [ihnp4, allegra, cbosg, utcsstat, hogpc, ...]!pegasus!avi