Path: utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!ucbvax!UIAMVS.BITNET!AWCTTYPA From: AWCTTYPA@UIAMVS.BITNET ("David A. Lyons") Newsgroups: comp.sys.apple Subject: CHR$(4), RETURNs, DOS3.3, BASIC.SYSTEm Message-ID: <8901290132.aa16249@SMOKE.BRL.MIL> Date: 29 Jan 89 07:24:59 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 48 X-Unparsable-Date: Saturday 28 Jan 89 10:06 PM CT >Date: Thu, 26 Jan 89 15:05:00 EST >From: "Kevin N. Gunn" >Subject: Chr$(4) and Linefeeds > >I've come across this problem before (and fixed it by issuing a print >chr$(4) twice, the first of which is, of course, terminated by a >carraige return, thus solving the problem). What I'd like to know is >WHY DOS 3.3 NEEDS that carraige return. The DOS 3.3 parser just watched characters as they were printed and went into different modes depending on what it saw. Seeing a carriage return (Ctrl-M) made it go into a mode where a Ctrl-D would make it go into collect-a-DOS-command mode. I don't know of a really good reason to require a return right before a command, except that it lets you put Ctrl-D's into your files if you want, as long as they aren't at the beginnings of lines. BASIC.SYSTEM does things in a much more complicated way: It turns on TRACE mode and intercepts all the "#" signs and line numbers that Applesoft prints; when it finds a "#" it checks the stack & zero page to see what's going on, so it always knows what BASIC command is being executed. Things like TRACE and NOTRACE are handled specially, and most importantly it remembers whether a PRINT is in progress or not. Under BASIC.SYSTEM a command is collected only if the Ctrl-D was the first character printed by a PRINT statement. By the way, just PRINT by itself prints a CHR$(13). "PRINT" and "PRINT CHR$(13);" are identical. "PRINT CHR$(13)" (no semicolon) prints _two_ returns. So PRINT:PRINT CHR$(4);"xxxxx" is sufficient to make sure DOS 3.3 sees a command. >Carraige return sure is a strange anachronism when applied to a video >screen, isn't it? > >-Kevin N. Gunn >unckng@unc Yes. So are Line-feed (Ctrl-J) and formfeed (Ctrl-L) (nothing really gets fed on the screen), and Bell (Ctrl-G) (there's no physical bell in most equipment; just a speaker & an electronic noise of some sort). Shift keys no longer shift a tray of keys up or down to let a different part of the metal hit the paper, either. Well, not on the screen or most printers, anyway. --David A. Lyons bitnet: awcttypa@uiamvs DAL Systems CompuServe: 72177,3233 P.O. Box 287 GEnie mail: D.LYONS2 North Liberty, IA 52317 AppleLinkPE: Dave Lyons