Information générale
Catégorie:
Codage, syntaxe et commandes
>Good. Chr(13) + chr(10) is the standard combination for end-of-line in Windows and DOS; unfortunately, other systems use other combinations. For Excel Automation, I had to use chr(10) only, if I remember correctly - the chr(13) shows up as a big ugly rectangle.
As you stated CHR(13)+CHR(10) (carriage return followed by line feed) is used by DOS and Windows as an end-of-line sequence
Unix traditionaly uses CHR(10) (line feed)
Some systems used CHR(13) (carriage return) -- I do vaguey recall this, but I don't recall which ones (it migh've been the Sinclair ZX-80/81 micros, along wih a few others).
And of course there is fun with dealing with other character codes like EBCDIC... or CDC 6-bit and 6/12-bit character codes (Since 6-bit code doesn't allow for "invisible" control codes, things like EOF and EOLN were defined according to specifc bit-patters that were aligned to a word boundary, which were 60 bits long)...
There were also a few systems that used CHR(10)+CHR(13) (line feed followed by carriage return). The hard bit was visually speaking, the effect was indistiguishable from the CHR(13)+CHR(10) sequence if you simpy display the file -- it's when your text editor did strange things with the text (e.g. everything gets double-spaced and last character of each line or first character of each line gets "eaten") that you notice something is amiss.
And to think... all this confusion with just a "simple" text file...
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement