Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!att!chinet!patrick From: patrick@chinet.chi.il.us (Patrick A. Townson) Newsgroups: comp.sys.apple Subject: Re: Chr$(4) and Linefeeds Message-ID: <7560@chinet.chi.il.us> Date: 28 Jan 89 14:58:57 GMT References: <8901270945.aa15170@SMOKE.BRL.MIL> Reply-To: patrick@chinet.chi.il.us (Patrick A. Townson) Organization: Chinet - Public Access Unix Lines: 28 In article <8901270945.aa15170@SMOKE.BRL.MIL> UNCKNG@UNC.BITNET ("Kevin N. Gunn") writes: > 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. > >Carraige return sure is a strange anachronism when applied to a >video screen, isn't it? It isn't that it needs a LF or CR, but rather, a DOS command be the first command on a multi-command line. A CR insures that the command which follows immediatly is the first command on a line. It is common in Applesoft to print something, and terminate the print statement with a semi-colon, which then will suspend the CR/LF and force the next print statement to begin right at the end of the first one. Depending on the complexity of the code, somewhere along the line you may have left a print statement unclosed in this fashion. If so, and you hit a line of code with a DOS command, then that command will not execute correctly. Setting up D$ = CHR$(13);CHR$(4) right from the beginning of your program insures a new line will be started when you need one in this context. -- Patrick Townson patrick@chinet.chi.il.us / US Mail: 60690-1570 (personal zip code) FIDO: 115/743 / AT&T Mail: 529-6378 (!ptownson) / MCI Mail: 222-4956