News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

Carriage return discussion (split from pak128.Britain graphics to-do list)

Started by Reddog785, May 08, 2010, 05:47:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Reddog785

Quote from: jamespetts on May 08, 2010, 04:27:59 PM
Reddog,

see here for information on contributing graphics to Pak128.Britain. As to your first question - in what context do you ask? A line break normally simply means a break between lines of ASCII text as in:

^^ That was a line break.

But please note that nobody will be able to use your narrow gauge vehicles until somebody draws narrow gauge tracks, narrow gauge depots, narrow gauge stations, narrow gauge bridges, narrow gauge tunnels and narrow gauge crossings.

I mean in coding. Notepad apparently displays them as little boxes.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Reddog785


jamespetts

 In Wordpad, you can just use an ordinary carriage return.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


rsdworker

its called return - its usually shown on keyboard - either enter or return button makes a icon move to next place

VS

#6
Another explanation: it's an invisible letter that means (forced) end of one line...

Line one,
Line two.

...there's a line break between these two, just behind the comma.

thread split from http://forum.simutrans.com/index.php?topic=3009.0

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Reddog785

Ugh...you don't understand! The article on the Simutrans Wiki about making Simutrans goodies said "Please don't use Notepad, it dosen't have linebreaks" and there is a picture of code like this:
cityrules.tab[]#[]#

As you can see, Notepad replaces the linebreaks with little boxes. What are THESE linebreaks meant to be? How do I type them?

VS

If it says "doesn't have" then it's wrongly worded. Notepad has them of course, but only one kind out of three - that is the problem. You are not supposed to see them anyway. That picture just illustrates that notepad doesn't do it properly for these other two cases: Instead of ending the lines, it draws some weird boxes and goes on with the line.

But this discussion is moot. That requirement for dat files is obsolete. Newer makeobj versions handle line breaks just fine natively, so use notepad and everything will work. The only problems might be when you open older files.

If you want to be 100% on the safe side, use notepad++ or pspad or or or... there are lots of good text editors that understand line breaks of all 3 kinds. The two I named are just the most popular on Windows these days.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

neroden

For a starter on this topic, reddog, the important thing to remember is that computers don't really know what letters are, all they know is binary.  Different computer systems have different ways of encoding text into binary.  Almost all use variants of the "ASCII" code nowadays.  This standardized the encoding of the 10 Arabic numerals, the 26 Latin alphabet characters (uppercase and lowercase), "space", and some punctuation.  Unfortunately it didn't standardize everything:  there are two different common ways of encoding a "line break", as well as two uncommon ways.

The difference between the different encodings can be seen most clearly if you open up a text file with a hex editor.

Simutrans doesn't care what encoding you use for linebreaks any more. 

Many programming tools can handle both, but notice that they're different, which is why I'm having problems with "spurious differences" -- they notice that the linebreaks are encoded differently and decide that OMG EVERY LINE IN THE FILE HAS CHANGED!  The version control systems (subversion, git) have tools for automatically ironing out the differences by making sure the linebreaks are all standardized automatically when they're checked in -- but the tools have to be *turned on*, which so far they haven't been.... but that's another topic, literally....

Reddog785

Quote from: VS on May 09, 2010, 05:14:06 PM
If it says "doesn't have" then it's wrongly worded. Notepad has them of course, but only one kind out of three - that is the problem. You are not supposed to see them anyway. That picture just illustrates that notepad doesn't do it properly for these other two cases: Instead of ending the lines, it draws some weird boxes and goes on with the line.

But this discussion is moot. That requirement for dat files is obsolete. Newer makeobj versions handle line breaks just fine natively, so use notepad and everything will work. The only problems might be when you open older files.

If you want to be 100% on the safe side, use notepad++ or pspad or or or... there are lots of good text editors that understand line breaks of all 3 kinds. The two I named are just the most popular on Windows these days.

Errmm... So, where the weird boxes are, what do I type? A space? A new line?

neroden

Quote from: Reddog785 on May 10, 2010, 03:46:36 PM
Errmm... So, where the weird boxes are, what do I type? A space? A new line?

The "weird boxes" are how old versions of Notepad interpret hexadecimal 0A by itself.  Most programs interpret hexadecimal 0A as "line break".  If you are seeing weird boxes, *use a different text editor*.  If you aren't seeing weird boxes on your machine, don't worry about it.

If you replace each "weird box" with a line break in Notepad, you'll create a file with lots of hexadecimal "0D 0A" sequences in it, because that's what Notepad writes when you put in a line break.

Simutrans can handle either "0D 0A" or "0A" by itself and knows that either means "line break".

wlindley

Historically, UNIX used 0A (ASCII line feed) as end-of-line; CP/M, its clone MS-DOS, and then Windows use 0D 0A (carriage return, line feed) as end-of-line; and old MacOS used just 0D as carriage return alone.  Let's hear it for standards!

VS

Reddog - just write :)

edit: removed previous text after ~2 min.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

neroden

Quote from: wlindley on May 10, 2010, 08:51:02 PM
Historically, UNIX used 0A (ASCII line feed) as end-of-line; CP/M, its clone MS-DOS, and then Windows use 0D 0A (carriage return, line feed) as end-of-line; and old MacOS used just 0D as carriage return alone.  Let's hear it for standards!


And certain mainframes, along with most actual teletype machines, used 0A 0D (notice the different order).  :)