Use of leading space for numbers: Difference between revisions

From LDraw.org Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 18: Line 18:
'''at parts and subparts'''<br />
'''at parts and subparts'''<br />
* if the word 'type' is the last word before that number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [http://www.ldraw.org/library/official/parts/6099p04.dat])
* if the word 'type' is the last word before that number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [http://www.ldraw.org/library/official/parts/6099p04.dat])
* if the letter 'V' is direct attached to the number (Electric 9V Battery Box  4 x 14 x  4 (Complete Shortcut) - [http://www.ldraw.org/library/official/parts/2847c01.dat])
* if the letter 'L' is direct attached to the number (Bar 3L - [http://www.ldraw.org/library/official/parts/87994.dat])
* if the word 'Road' is the last word before that number and the letters '-Studs' are direct attached to the number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [http://www.ldraw.org/library/official/parts/6099p04.dat])
* if the word 'Road' is the last word before that number and the letters '-Studs' are direct attached to the number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [http://www.ldraw.org/library/official/parts/6099p04.dat])


Now that I have had a deeper look to this I feel that it is at present much easier than I thought - "''As soon as the number is directly (without whitespace) followed by an letter there is no additional whitespace in front of the number''".<br />
My earlier resumee at this place has been wrong. The real old part with L, V and H direct after the number do have a leading whitespace. And that makes sense to me because of the sort order.(2011-06-25)<br />


'''at primitives'''<br />
'''at primitives'''<br />

Revision as of 10:37, 25 June 2011

The reason for using leading space in front of numbers lower than ten (10) is the sort order in listings.
Example: (wrong order)
Brick 10 x 10
Brick 2 x 2
These two description would be in a list just the wrong way because the seventh character (as it is the first different) will decide about the sort order.
So if we add a whitespace in front of the 2 we have "whitespace" and "1" at the seventh character. Because the "whitespace" has a lower internal value as the "1" the correct sorting order will be visible.
To show it visually here I had to substitude the whitespace by underscore.
Example: (correct order)
Brick__2_x__2
Brick_10_x_10

As this has not been considered from the beginning of the library there are little inconsistances in the library.
I like to mention here what I had discovered so far that does not follow the simple rule - "If number is used and number is lower than 10 use a second whitespace in front of that number":
at parts and subparts

  • if the word 'type' is the last word before that number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [1])
  • if the word 'Road' is the last word before that number and the letters '-Studs' are direct attached to the number (Baseplate 32 x 32 Road 9-Stud Landing Pad Type 1 (Orange) - [2])

My earlier resumee at this place has been wrong. The real old part with L, V and H direct after the number do have a leading whitespace. And that makes sense to me because of the sort order.(2011-06-25)

at primitives

  • if word 'Torus' is in the description only the first of the numbers needs a leading whitespace
  • if word 'Circle' is in the description none of the numbers needs a leading whitespace
  • if word 'Cylinder' is in the description none of the numbers needs a leading whitespace
  • if word 'Cone' is in the description only the first of the numbers needs a leading whitespace
  • if word 'Ring' is in the description only the first of the numbers needs a leading whitespace
  • if word 'Disc' is in the description none of the numbers needs a leading whitespace
  • if word 'Chord' is in the description none of the numbers needs a leading whitespace

If you have an original part that does not fit into this scheme please inform us. Please do not use the parts on the PT as reference because there are parts that follow not these rules maybe because of the usage of DATHeader.
To bring DATHeader in a good condition I like to have this cleared if possible.
The soon coming version 3.0.8.0 of DATHeader will act as described here but without a correct check on the primitives.

--Mikeheide 16:32, 24 June 2011 (EDT)