# Question on displaying loaded txt files

**URL:** <https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675>\
**Category:** Uncategorized\
**Created:** [May 24, 2003, 7:27pm UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675 "2003-05-24T19:27:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![glitch007](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@glitch007](https://forum.kirupa.com/u/glitch007)\
**Post date:** [May 24, 2003, 7:27pm UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/1 "2003-05-24T19:27:35Z")

</div>

I looked at this tutorial [http://www.kirupa.com/developer/mx/dynamic\_scroller.htm](http://www.kirupa.com/developer/mx/dynamic_scroller.htm)  
it helped a lot, however there is still one small thing that i want to fix

I’ve noticed that the text displayed in the textbox is not the same as the text in the txt file with respect to the line spacings (eg. If I press a hard return in the txt, it skips 2 lines in the textbox) How do I fix that?

Eg. (in text file)  
kirupaText=Hello  
world

(in text field)  
Hello

world

but I don’t want a space between the two words

any1 know how to fix it?  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 24, 2003, 8:54pm UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/2 "2003-05-24T20:54:11Z")

</div>

You can format your text in HTML in the text file. Digitalosophy tells us how on page one, post 13 of this:

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24012&highlight=HTML](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24012&highlight=HTML)

(-:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 25, 2003, 3:45am UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/3 "2003-05-25T03:45:56Z")

</div>

I’ve got the same code as  
\<code\>  
loadText = new loadVars();  
loadText.load(“publications.txt”);  
loadText.onLoad = function() {  
scroller.html = true;  
scroller.htmlText = this.publicationsText;  
};  
\</code\>  
the problem is that if you press enter in the txt file to go to the next line, it loads up in the text box, but it skips 2 lines. It doesn’t matter if the text is htmlText or not

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 25, 2003, 9:01am UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/4 "2003-05-25T09:01:23Z")

</div>

I actually use loading text a lot, but I haven’t tried the HTML version of it yet. Instead of hitting enter, try using \<br\> in your text file. I will actually try this tomorrow to see if it works. That’s my best guess right now, anyhow.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 25, 2003, 12:43pm UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/5 "2003-05-25T12:43:57Z")

</div>

Check this post out; it should explain things: \<a href=“[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23646](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23646)”\>[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23646](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23646)\</a\>.

Later,  
–Elios

P.S. The escape sequence you’ll be looking for is “%0d” for carriage return, btw.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 25, 2003, 2:18pm UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/6 "2003-05-25T14:18:37Z")

</div>

So that would mean that I would have to put everything (in the txt file) in one line? But then the text file is gonna look really messy when I’m trying to edit it cuz everything is on one line

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 25, 2003, 6:28pm UTC](https://forum.kirupa.com/t/question-on-displaying-loaded-txt-files/21675/7 "2003-05-25T18:28:15Z")

</div>

Yeah, but, if you wanted to get really ingenuitive (sp?) you could load it ignoring white space, but you’d have to put a %20 for every real space. Like…

```php

&elios=The%20Lazy%0dBum&

```

Would be the same as…

```php

&elios=The%20

Lazy

%0d

 Bum
&

```

With Ignore whitespace on. You can find out how to do that in the help files. But, like in one of the previous posts, HTML probably looks better…

```php

&elios=The Lazy
<BR>
Bum&

```

Anyway,  
–Elios
