1. 102bakslashin --read as "ten to \n"
- Posted by Lewis Townsend <keroltarr at HOTMAIL.COM> Nov 17, 1998
- 519 views
Hello everyone, When I tried to view "jk200.e" from Jese Kint in Notepad, I found that it displayed the newline characters rather than doing a carriage return. I didn't want to manually enter the returns into the file so I wrote a simple program to do it for me. I'm sure this took much longer since it was a fairly short file. My program replaces all instances of ASCII 10 with '\n'. On a hunch I added this line to the end of the file: ? '\n' It printed "10" so it looks like my proggie really did nothing. However it DID fix the file. It looks fine (no weird little blocks). But essentially I just replaced 10 with 10. What's going on here? confused, Lewis Townsend |\ F""\ | | /""\ | \ |_ \ |\ | | \__ | \ | \ | \ | | \ | \L___ \| \| | \__/ | |\ \ | | \ \ |""\ T==TT==7 | | \ \ | | || | |___\ \ |__/ || | \ | \ || |_________\| \ || ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
2. Re: 102bakslashin --read as "ten to \n"
- Posted by Lucius Hilley III <lhilley at CDC.NET> Nov 18, 1998
- 515 views
Well the answer is simple. You probably opened the file and saved the file in the following manner. --WARNING --Rough draft code. include get.e -- I don't think this is needed here. integer in, out sequence line in = open("infile", "r")--Note: "r" or "rb" won't make a difference here. out = open("outfile", "w")--You saved using "w" not "wb" if (in = -1) or (out = -1) then close(in) close(out) puts(1, "one of the files failed to open so close both and abort") abort(0) end if line = gets(in)--reading in as text or binary while sequence(line) do puts(out, line)--writing as text. Converts from UNIX to DOS text format. line = gets(in)--reading in as text or binary end while I hope this clears things up a bit. _________________________ Lucius L. Hilley III <A HREF="mailto:lhilley at cdc.net">lhilley at cdc.net</A> http://www.cdc.net/~lhilley http://www.americanantiques.com http://www.dragonvet.com _________________________ On Tue, 17 Nov 1998 13:14:36 PST, Lewis Townsend <keroltarr at HOTMAIL.COM> wrote: >Hello everyone, > >When I tried to view "jk200.e" from Jese Kint in Notepad, I found that >it displayed the newline characters rather than doing a carriage return. >I didn't want to manually enter the returns into the file so I wrote a >simple program to do it for me. I'm sure this took much longer since it >was a fairly short file. > My program replaces all instances of ASCII 10 with '\n'. On a hunch >I added this line to the end of the file: > ? '\n' >It printed "10" so it looks like my proggie really did nothing. However >it DID fix the file. It looks fine (no weird little blocks). But >essentially I just replaced 10 with 10. > >What's going on here? > >confused, >Lewis Townsend >|\ F""\ | | /""\ >| \ |_ \ |\ | | \__ >| \ | \ | \ | | \ >| \L___ \| \| | \__/ >| |\ \ >| | \ \ |""\ T==TT==7 >| | \ \ | | || >| |___\ \ |__/ || >| \ | \ || >|_________\| \ || > >______________________________________________________ >Get Your Private, Free Email at http://www.hotmail.com